/**
 * My Sites Portal Styles
 *
 * @package AIN_License_Server
 * @since 1.0.0
 */

/* Font Faces */
@font-face {
    font-family: 'PompeiBlock';
    src: url('fonts/PompeiBlock_FS-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PompeiBlock';
    src: url('fonts/PompeiBlock_FS-Demibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PompeiBlock';
    src: url('fonts/PompeiBlock_FS-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #CD9C71;
    --color-primary-dark: #b88a5e;
    --color-secondary: #5E4E40;
    --color-danger: #d63638;
    --color-danger-dark: #b32d2e;
    --color-success: #00a32a;
    --color-text: #1d2327;
    --color-text-muted: #50575e;
    --color-border: #c3c4c7;
    --color-bg: #EFE6EF;
    --color-white: #ffffff;
    --font-family: 'PompeiBlock', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 4px;
    --radius-lg: 12px;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Portal Layout */
.portal {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.portal-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.portal-header__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-secondary);
    text-align: center;
}

.portal-header__user {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    left: 24px;
}

.portal-header__email {
    color: var(--color-text-muted);
    font-size: 14px;
}

.portal-header__logout {
    background: none;
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.portal-header__logout:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

/* Header Navigation */
.portal-header__nav {
    display: flex;
    gap: 8px;
    position: absolute;
    right: 24px;
}

.portal-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.portal-nav-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.portal-nav-btn--active {
    background: var(--color-primary);
    color: var(--color-white);
}

.portal-nav-btn--active:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.portal-nav-btn svg {
    flex-shrink: 0;
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: 40px 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Sections */
.portal-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Section */
.portal-login {
    width: 450px;
    max-width: 100%;
    margin: 0 auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Center login section vertically */
.portal-main:has(.portal-login:only-child),
.portal-main:has(.portal-login[style*="block"]) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

/* Card */
.portal-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.portal-sites .portal-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.portal-card--table {
    padding: 0;
    overflow: hidden;
}

.portal-card__title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.portal-card__subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 32px;
}

/* Steps */
.portal-step--hidden {
    display: none;
}

/* Fields */
.portal-field {
    margin-bottom: 20px;
}

.portal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text);
}

.portal-field input[type="email"],
.portal-field input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(205, 156, 113, 0.2);
}

#login-code {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-family: monospace;
}

/* Checkbox Field */
.portal-field--checkbox {
    margin-bottom: 24px;
}

.portal-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.portal-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.portal-checkbox__label {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* OTP Message */
.portal-otp-message {
    background: #f0f6fc;
    border-right: 4px solid #72aee6;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: var(--radius);
}

/* Buttons */
.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.portal-btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.portal-btn--primary:hover {
    background: var(--color-primary-dark);
}

.portal-btn--secondary {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.portal-btn--secondary:hover {
    background: var(--color-bg);
}

.portal-btn--danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.portal-btn--danger:hover {
    background: var(--color-danger-dark);
}

.portal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Actions */
.portal-actions {
    display: flex;
    gap: 12px;
}

.portal-actions .portal-btn {
    flex: 1;
}

/* Messages */
.portal-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: none;
}

.portal-message--success {
    display: block;
    background: #d4edda;
    border-right: 4px solid var(--color-success);
    color: #155724;
}

.portal-message--error {
    display: block;
    background: #f8d7da;
    border-right: 4px solid var(--color-danger);
    color: #721c24;
}

/* Sites Section */
.portal-sites__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.portal-sites__title {
    font-size: 28px;
    font-weight: 600;
}

.portal-sites__stats {
    display: flex;
    gap: 24px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.portal-sites__stats strong {
    color: var(--color-text);
}

/* Table */
.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    padding: 16px 20px;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
}

.portal-table th {
    background: var(--color-bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-muted);
}

.portal-table td {
    font-size: 15px;
}

.portal-table tbody tr:hover {
    background: #fafafa;
}

.portal-table tbody tr:last-child td {
    border-bottom: none;
}

/* Domain Cell */
.portal-domain {
    font-weight: 500;
}

.portal-nickname {
    color: var(--color-text-muted);
    font-size: 14px;
}

.portal-nickname--empty {
    font-style: italic;
}

/* Date Cell */
.portal-date {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Actions Cell */
.portal-table-actions {
    position: relative;
    width: 48px;
    text-align: center;
}

.portal-menu-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.portal-menu-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.portal-menu-btn svg {
    display: block;
}

/* Empty State */
.portal-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--color-text-muted);
}

/* Dropdown Menu */
.portal-dropdown {
    position: fixed;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.portal-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    text-align: right;
    transition: background 0.15s ease;
}

.portal-dropdown__item:hover {
    background: var(--color-bg);
}

.portal-dropdown__item--danger {
    color: var(--color-danger);
}

.portal-dropdown__item--danger:hover {
    background: #fef2f2;
}

.portal-dropdown__item--disabled {
    color: var(--color-border);
    cursor: not-allowed;
}

.portal-dropdown__item--disabled:hover {
    background: transparent;
}

.portal-dropdown__item--disabled svg {
    opacity: 0.5;
}

/* OTP Display */
.portal-otp-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
}

.portal-otp-display__code {
    font-size: 32px;
    font-family: monospace;
    letter-spacing: 8px;
    font-weight: 600;
    color: var(--color-secondary);
}

.portal-otp-display__copy {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-otp-display__copy:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.portal-otp-display__copy--copied {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--color-white);
}

.portal-otp-display__expiry {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Profile Section */
.portal-profile__header {
    margin-bottom: 24px;
}

.portal-profile__title {
    font-size: 28px;
    font-weight: 600;
}

.portal-profile .portal-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    max-width: 500px;
}

.portal-form__actions {
    margin-top: 24px;
}

.portal-form__actions .portal-btn {
    width: auto;
    min-width: 140px;
}

/* Email display */
.portal-field--email label {
    margin-bottom: 8px;
}

.portal-email-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg);
    border-radius: var(--radius);
}

.portal-email-text {
    font-size: 15px;
    color: var(--color-text);
    flex: 1;
}

.portal-btn--small {
    padding: 6px 12px;
    font-size: 13px;
    width: auto;
}

/* Phone input RTL */
.portal-field input[type="tel"] {
    text-align: left;
}

/* Plugins Section */
.portal-plugins__header {
    margin-bottom: 24px;
}

.portal-plugins__title {
    font-size: 28px;
    font-weight: 600;
}

.portal-plugins__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Plugin Card */
.portal-plugin-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.portal-plugin-card__header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.portal-plugin-card__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-plugin-card__icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.portal-plugin-card__info {
    flex: 1;
}

.portal-plugin-card__name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.portal-plugin-card__desc {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.portal-plugin-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.portal-plugin-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-plugin-card__version {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.portal-plugin-card__actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.portal-plugin-card__actions .portal-btn {
    width: auto;
    min-width: 140px;
}

/* Changelog */
.portal-plugin-card__changelog {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.portal-plugin-card__changelog-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.portal-plugin-card__changelog-title svg {
    transition: transform 0.2s ease;
}

.portal-plugin-card__changelog-title.is-open svg {
    transform: rotate(180deg);
}

.portal-plugin-card__changelog-content {
    display: none;
}

.portal-plugin-card__changelog-content.is-open {
    display: block;
}

.portal-changelog-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-bg);
}

.portal-changelog-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.portal-changelog-item__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.portal-changelog-item__version {
    font-weight: 600;
    color: var(--color-secondary);
}

.portal-changelog-item__date {
    color: var(--color-text-muted);
    font-size: 13px;
}

.portal-changelog-item__content {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Goodbye Section */
.portal-goodbye {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.portal-goodbye__content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.portal-goodbye__icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: var(--color-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.portal-goodbye__title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-secondary);
}

.portal-goodbye__text {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.portal-goodbye .portal-btn {
    width: auto;
    min-width: 180px;
}

/* Feature Requests Section */
.portal-requests__header {
    margin-bottom: 24px;
}

.portal-requests__title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.portal-requests__subtitle {
    color: var(--color-text-muted);
}

.portal-requests .portal-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
}

/* Required indicator */
.portal-required {
    color: var(--color-danger);
}

/* Radio Group */
.portal-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.portal-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.portal-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.portal-radio__label {
    font-size: 14px;
}

/* Textarea */
.portal-field textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(205, 156, 113, 0.2);
}

/* File Upload */
.portal-file-upload {
    position: relative;
}

.portal-file-upload__input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.portal-file-upload__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    text-align: center;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.portal-file-upload__label:hover,
.portal-file-upload:focus-within .portal-file-upload__label {
    border-color: var(--color-primary);
    background: rgba(205, 156, 113, 0.05);
}

.portal-file-upload__label svg {
    color: var(--color-primary);
}

.portal-file-upload__label small {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* File List */
.portal-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.portal-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--color-bg);
    border-radius: var(--radius);
    font-size: 14px;
}

.portal-file-item__name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.portal-file-item__name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-file-item__remove {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

.portal-file-item__remove:hover {
    color: var(--color-danger);
}

/* Turnstile */
.portal-field--turnstile {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

/* Request Success */
.portal-request-success {
    text-align: center;
    padding: 40px 20px;
}

.portal-request-success__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
}

.portal-request-success h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.portal-request-success p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.portal-request-success .portal-btn {
    width: auto;
}

/* Guides Section */
.portal-guides__header {
    margin-bottom: 24px;
}

.portal-guides__title {
    font-size: 28px;
    font-weight: 600;
}

.portal-guides__layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    min-height: 400px;
}

/* Guides Sidebar */
.portal-guides__sidebar {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

.portal-guides__loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 20px;
}

.portal-guides__categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-guides__category {
    margin-bottom: 4px;
}

.portal-guides__category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-align: right;
}

.portal-guides__category-btn:hover {
    background: var(--color-bg);
}

.portal-guides__category-btn.is-active {
    background: var(--color-primary);
    color: var(--color-white);
}

.portal-guides__category-count {
    font-size: 12px;
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--color-text-muted);
}

.portal-guides__category-btn.is-active .portal-guides__category-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Guides Content */
.portal-guides__content {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 300px;
}

.portal-guides__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 40px;
}

.portal-guides__empty svg {
    color: var(--color-border);
}

/* Article List */
.portal-guides__article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-guides__article-item {
    border-bottom: 1px solid var(--color-border);
}

.portal-guides__article-item:last-child {
    border-bottom: none;
}

.portal-guides__article-link {
    display: block;
    padding: 16px 0;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.portal-guides__article-link:hover {
    color: var(--color-primary);
}

.portal-guides__article-link h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.portal-guides__article-link p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

/* Single Article View */
.portal-guides__back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-primary);
    cursor: pointer;
    margin-bottom: 20px;
}

.portal-guides__back-btn:hover {
    text-decoration: underline;
}

.portal-guides__article-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.portal-guides__article-meta {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.portal-guides__article-content {
    font-size: 15px;
    line-height: 1.8;
}

.portal-guides__article-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
}

.portal-guides__article-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 20px 0 10px;
}

.portal-guides__article-content p {
    margin-bottom: 16px;
}

.portal-guides__article-content ul,
.portal-guides__article-content ol {
    margin-bottom: 16px;
    padding-right: 20px;
}

.portal-guides__article-content li {
    margin-bottom: 8px;
}

.portal-guides__article-content code {
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.portal-guides__article-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 16px;
}

.portal-guides__article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Responsive Guides */
@media screen and (max-width: 768px) {
    .portal-guides__layout {
        grid-template-columns: 1fr;
    }

    .portal-guides__sidebar {
        position: static;
    }
}

/* Modal */
.portal-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.portal-modal__content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.portal-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.portal-modal__text {
    color: var(--color-text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.portal-modal__text strong {
    color: var(--color-text);
}

.portal-modal__warning {
    background: #fcf9e8;
    border-right: 4px solid #996800;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: #996800;
    font-size: 14px;
    margin-bottom: 24px;
}

.portal-modal__actions {
    display: flex;
    gap: 12px;
}

.portal-modal__actions .portal-btn {
    flex: 1;
}

/* Footer */
.portal-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 20px 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Loading State */
.portal-loading {
    position: relative;
    pointer-events: none;
}

.portal-loading::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: inherit;
}

/* Accessibility */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: var(--radius);
    z-index: 9999;
    text-decoration: none;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Visually Hidden (Screen Reader Only) */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .portal-btn--primary,
    .portal-btn--danger {
        border: 2px solid currentColor;
    }

    .portal-modal__backdrop {
        background: Canvas;
        opacity: 0.9;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .portal-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .portal-main {
        padding: 24px 16px;
    }

    .portal-card {
        padding: 24px;
    }

    .portal-sites__header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .portal-sites__stats {
        justify-content: center;
    }

    .portal-table th,
    .portal-table td {
        padding: 12px;
    }

    .portal-table th:nth-child(2),
    .portal-table td:nth-child(2) {
        display: none;
    }

    .portal-modal__content {
        padding: 24px;
    }

    .portal-modal__actions {
        flex-direction: column;
    }
}
