:root {
    --portal-bg: #091326;
    --portal-bg-soft: #102548;
    --portal-surface: #fffdf7;
    --portal-card: #ffffff;
    --portal-line: rgba(9, 19, 38, 0.08);
    --portal-text: #10233f;
    --portal-text-soft: #4f5f76;
    --portal-gold: #d5aa47;
    --portal-gold-strong: #bf8713;
    --portal-blue: #2f63bd;
    --portal-blue-soft: #edf4ff;
    --portal-green: #1d8d68;
    --portal-red: #b64d4d;
    --portal-radius-xl: 30px;
    --portal-radius-lg: 22px;
    --portal-radius-md: 18px;
    --portal-radius-sm: 14px;
    --portal-shadow: 0 24px 60px rgba(5, 12, 24, 0.14);
    --portal-shadow-soft: 0 12px 32px rgba(8, 19, 37, 0.08);
    --portal-font-display: 'Amiri', serif;
    --portal-font-body: 'Cairo', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--portal-font-body);
    color: var(--portal-text);
    background:
        radial-gradient(circle at top right, rgba(47, 99, 189, 0.24), transparent 30%),
        radial-gradient(circle at 20% 0%, rgba(213, 170, 71, 0.12), transparent 20%),
        linear-gradient(180deg, #081325 0%, #0d1d38 32%, #f7f2e9 32%, #f7f2e9 100%);
    line-height: 1.75;
}

a,
button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.portal-container {
    width: min(calc(100% - 32px), 1180px);
    margin: 0 auto;
}

.portal-button {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    transition: transform 220ms ease, background 220ms ease, color 220ms ease, border-color 220ms ease;
}

.portal-button:hover {
    transform: translateY(-2px);
}

.portal-button-primary {
    background: linear-gradient(135deg, var(--portal-gold), var(--portal-gold-strong));
    color: #0f213c;
}

.portal-button-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}

.portal-button-light {
    background: #fff;
    color: var(--portal-text);
    border-color: rgba(9, 19, 38, 0.12);
}

.portal-header {
    padding: 22px 0;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 28px;
    background: rgba(8, 19, 37, 0.88);
    border: 1px solid rgba(213, 170, 71, 0.18);
    box-shadow: var(--portal-shadow);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.portal-brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(213, 170, 71, 0.6);
    color: var(--portal-gold);
    font-family: var(--portal-font-display);
    font-size: 1.25rem;
}

.portal-brand-copy {
    display: flex;
    flex-direction: column;
}

.portal-brand-copy strong {
    color: #fff;
    font-size: 1.15rem;
}

.portal-brand-copy small {
    color: rgba(213, 170, 71, 0.92);
}

.portal-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-auth-shell {
    min-height: calc(100vh - 120px);
    padding: 10px 0 48px;
    display: grid;
    align-items: center;
}

.portal-auth-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 24px;
    align-items: center;
}

.portal-auth-copy,
.portal-card {
    border-radius: var(--portal-radius-xl);
    background: var(--portal-card);
    border: 1px solid var(--portal-line);
    box-shadow: var(--portal-shadow-soft);
}

.portal-auth-copy {
    padding: 34px;
    position: relative;
    overflow: hidden;
}

.portal-auth-copy::after {
    content: '';
    position: absolute;
    inset-inline-end: -70px;
    top: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 99, 189, 0.16), transparent 70%);
}

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(213, 170, 71, 0.12);
    color: var(--portal-gold-strong);
    font-weight: 800;
    margin-bottom: 16px;
}

.portal-auth-copy h1,
.portal-panel-title {
    margin: 0;
    font-family: var(--portal-font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.2;
}

.portal-auth-copy p,
.portal-muted {
    color: var(--portal-text-soft);
}

.portal-auth-points {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.portal-auth-points span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 16px;
    background: #f5f8ff;
    color: var(--portal-text);
    font-weight: 700;
}

.portal-auth-points i {
    color: var(--portal-blue);
}

.portal-card {
    padding: 28px;
}

.portal-card h2 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.portal-card p {
    margin: 0 0 20px;
    color: var(--portal-text-soft);
}

.portal-form {
    display: grid;
    gap: 16px;
}

.portal-field {
    display: grid;
    gap: 8px;
}

.portal-field label {
    font-weight: 800;
}

.portal-field input,
.portal-field textarea,
.portal-field select {
    width: 100%;
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(9, 19, 38, 0.12);
    background: #fff;
    padding: 0 16px;
    outline: none;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}

.portal-field textarea {
    min-height: 120px;
    padding-block: 14px;
    resize: vertical;
}

.portal-field input:focus,
.portal-field textarea:focus,
.portal-field select:focus {
    border-color: rgba(47, 99, 189, 0.5);
    box-shadow: 0 0 0 4px rgba(47, 99, 189, 0.08);
}

.portal-error {
    color: var(--portal-red);
    font-size: 0.92rem;
}

.portal-form-actions {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.portal-inline-links,
.portal-locale-list,
.portal-social-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-inline-links a,
.portal-locale-list a,
.portal-social-list a {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
}

.portal-inline-links a {
    background: #f5f8ff;
    color: var(--portal-blue);
}

.portal-locale-list a {
    background: #fff;
    border: 1px solid rgba(9, 19, 38, 0.1);
    color: var(--portal-text);
}

.portal-locale-list a.active {
    background: var(--portal-text);
    color: #fff;
    border-color: var(--portal-text);
}

.portal-dashboard-shell {
    padding: 10px 0 56px;
}

.portal-dashboard-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    margin-bottom: 24px;
}

.portal-dashboard-banner {
    padding: 32px;
    border-radius: var(--portal-radius-xl);
    color: #fff;
    background: linear-gradient(135deg, rgba(8, 19, 37, 0.98), rgba(26, 59, 117, 0.94));
    box-shadow: var(--portal-shadow);
}

.portal-dashboard-banner h1 {
    margin: 0;
    font-family: var(--portal-font-display);
    font-size: clamp(2rem, 4vw, 3.4rem);
    color: #f3d489;
}

.portal-dashboard-banner p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.82);
}

.portal-status-card {
    padding: 24px;
    border-radius: var(--portal-radius-xl);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(9, 19, 38, 0.08);
    box-shadow: var(--portal-shadow-soft);
}

.portal-status-card h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
}

.portal-aid-banner,
.portal-notice {
    border-radius: 18px;
    padding: 16px 18px;
    margin-top: 14px;
}

.portal-aid-banner {
    background: rgba(29, 141, 104, 0.1);
    color: #145a44;
    border: 1px solid rgba(29, 141, 104, 0.22);
}

.portal-notice {
    background: #fff;
    border: 1px solid rgba(9, 19, 38, 0.08);
}

.portal-notice strong {
    display: block;
    margin-bottom: 6px;
}

.portal-notice a {
    color: var(--portal-blue);
    font-weight: 800;
    text-decoration: none;
}

.portal-stats-grid,
.portal-grid-3,
.portal-grid-2 {
    display: grid;
    gap: 18px;
}

.portal-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.portal-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.portal-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.portal-stat,
.portal-panel,
.portal-reel-card,
.portal-course-card,
.portal-resource-card,
.portal-live-card {
    border-radius: var(--portal-radius-lg);
    background: var(--portal-card);
    border: 1px solid var(--portal-line);
    box-shadow: var(--portal-shadow-soft);
}

.portal-stat {
    padding: 20px;
}

.portal-stat strong {
    display: block;
    font-size: 2rem;
    color: var(--portal-blue);
    line-height: 1;
}

.portal-stat span {
    display: block;
    margin-top: 10px;
    color: var(--portal-text-soft);
}

.portal-panel {
    padding: 24px;
}

.portal-panel-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.portal-panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.portal-badge {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: var(--portal-blue-soft);
    color: var(--portal-blue);
    font-size: 0.84rem;
    font-weight: 800;
}

.portal-badge-live {
    background: rgba(182, 77, 77, 0.12);
    color: var(--portal-red);
}

.portal-badge-green {
    background: rgba(29, 141, 104, 0.12);
    color: var(--portal-green);
}

.portal-course-card,
.portal-live-card,
.portal-resource-card {
    padding: 20px;
}

.portal-course-card h3,
.portal-live-card h3,
.portal-reel-card h3,
.portal-resource-card h3 {
    margin: 14px 0 8px;
    font-size: 1.2rem;
}

.portal-course-list,
.portal-resource-list,
.portal-social-list {
    display: grid;
    gap: 12px;
}

.portal-lesson {
    padding: 14px;
    border-radius: 16px;
    background: #fbfcff;
    border: 1px solid rgba(9, 19, 38, 0.08);
}

.portal-lesson strong {
    display: block;
    margin-bottom: 4px;
}

.portal-lesson a,
.portal-resource-card a,
.portal-live-card a,
.portal-reel-card a {
    color: var(--portal-blue);
    font-weight: 800;
    text-decoration: none;
}

.portal-reels-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.portal-reel-card {
    overflow: hidden;
}

.portal-reel-card img,
.portal-reel-placeholder {
    width: 100%;
    aspect-ratio: 0.8;
    object-fit: cover;
}

.portal-reel-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #173971, #3970cc);
    color: #fff;
    font-size: 2rem;
}

.portal-reel-body {
    padding: 18px;
}

.portal-footer {
    padding: 36px 0 20px;
    color: rgba(255, 255, 255, 0.76);
}

.portal-footer-shell {
    padding: 22px;
    border-radius: 24px;
    background: rgba(8, 19, 37, 0.88);
    border: 1px solid rgba(213, 170, 71, 0.16);
}

.portal-footer-shell p {
    margin: 0;
}

@media (max-width: 1080px) {
    .portal-auth-grid,
    .portal-dashboard-hero,
    .portal-grid-3,
    .portal-grid-2,
    .portal-reels-grid {
        grid-template-columns: 1fr;
    }

    .portal-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .portal-container {
        width: min(calc(100% - 24px), 1180px);
    }

    .portal-header {
        padding: 14px 0;
    }

    .portal-topbar {
        padding: 14px 16px;
        border-radius: 22px;
        flex-direction: column;
        align-items: stretch;
    }

    .portal-top-actions,
    .portal-inline-links,
    .portal-locale-list {
        flex-direction: column;
    }

    .portal-button,
    .portal-inline-links a,
    .portal-locale-list a {
        width: 100%;
        justify-content: center;
    }

    .portal-auth-shell,
    .portal-dashboard-shell {
        padding-bottom: 40px;
    }

    .portal-auth-copy,
    .portal-card,
    .portal-dashboard-banner,
    .portal-status-card,
    .portal-panel {
        padding: 20px;
    }

    .portal-stats-grid {
        grid-template-columns: 1fr;
    }
}
