:root {
    --maroon-primary: #800020;
    --maroon-dark: #5c0018;
    --maroon-darker: #3d0a0d;
    --maroon-deep: #1a0008;
    --gold-primary: #d4af37;
    --gold-light: #f0d875;
    --gold-dark: #b8960c;
    --ink: #1f1720;
    --muted: #716577;
    --glass-bg: rgba(255,255,255,0.06);
    --glass-border: rgba(240,216,117,0.18);
}

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

body.portal-ui {
    margin: 0;
    color: var(--ink);
    font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
    background: #0f0008;
    background-image:
        radial-gradient(ellipse 70% 50% at 8% 12%, rgba(212,175,55,0.1), transparent),
        radial-gradient(ellipse 50% 40% at 92% 8%, rgba(128,0,32,0.2), transparent),
        radial-gradient(ellipse 40% 35% at 50% 95%, rgba(92,0,24,0.25), transparent),
        linear-gradient(175deg, #0f0008 0%, #1a0008 40%, #2b0008 80%, #0f0008 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

body.portal-ui::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 30%, rgba(240,216,117,0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(128,0,32,0.06), transparent 50%);
    z-index: 0;
}

::selection {
    background: rgba(212,175,55,0.3);
    color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f0008; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.25); border-radius: 99px; }

/* ═══ Navigation ═══ */
.portal-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(15, 0, 8, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(240,216,117,0.12);
}

.portal-nav-inner {
    width: min(1100px, calc(100% - 1.5rem));
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.portal-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #1a0008;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    box-shadow: 0 2px 10px rgba(212,175,55,0.25);
}

.portal-links {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.portal-links a,
.portal-links button {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
    transition: color 200ms ease, background 200ms ease;
}

.portal-links a:hover,
.portal-links button:hover {
    color: var(--gold-light);
    background: rgba(240,216,117,0.08);
}

/* ═══ Auth Wrapper ═══ */
.portal-auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    position: relative;
    z-index: 1;
}

.portal-auth-card {
    width: min(1080px, 100%);
    background: rgba(255,255,255,0.04);
    border-radius: 24px;
    border: 1px solid rgba(240,216,117,0.12);
    box-shadow:
        0 24px 80px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.03) inset;
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ═══ Auth Head ═══ */
.portal-auth-head { margin-bottom: 20px; }

.portal-auth-head h1 {
    margin: 0;
    color: var(--maroon-dark);
}

.portal-auth-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

/* ═══ Login Shell ═══ */
.portal-login-shell {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: min(680px, 90vh);
}

/* ═══ Left Info Panel ═══ */
.portal-login-info {
    position: relative;
    padding: 40px 36px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 15%, rgba(240,216,117,0.15), transparent 40%),
        radial-gradient(circle at 85% 10%, rgba(163,50,77,0.3), transparent 35%),
        linear-gradient(150deg, #1a0008 0%, #3d0a0d 35%, #5c0018 65%, #800020 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-login-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(240,216,117,0.015) 40px,
            rgba(240,216,117,0.015) 41px
        );
    pointer-events: none;
}

.portal-login-kicker {
    display: inline-flex;
    font-size: 10.5px;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.portal-login-info h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.12;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #f0d875 60%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portal-login-info p {
    margin: 14px 0 0;
    color: rgba(255,255,255,0.78);
    max-width: 42ch;
    font-size: 14.5px;
    line-height: 1.7;
}

.portal-login-points {
    margin-top: 30px;
    display: grid;
    gap: 10px;
}

.portal-login-point {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(240,216,117,0.15);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: portalFadeSlide 600ms ease both;
    transition: border-color 250ms ease, background 250ms ease;
}

.portal-login-point:nth-child(2) { animation-delay: 100ms; }
.portal-login-point:nth-child(3) { animation-delay: 180ms; }

.portal-login-point:hover {
    border-color: rgba(240,216,117,0.3);
    background: rgba(255,255,255,0.06);
}

.portal-login-point i {
    color: var(--gold-light);
    font-size: 16px;
    flex-shrink: 0;
}

.portal-login-point span {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.portal-login-orbit {
    position: absolute;
    width: 300px;
    height: 300px;
    right: -90px;
    bottom: -90px;
    border-radius: 50%;
    border: 1px solid rgba(240,216,117,0.2);
    box-shadow:
        0 0 0 40px rgba(240,216,117,0.04),
        0 0 0 80px rgba(240,216,117,0.02);
    animation: portalPulse 5s ease-in-out infinite;
}

.portal-login-orbit::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 12px rgba(212,175,55,0.5);
    animation: portalOrbitDot 6s linear infinite;
}

/* ═══ Right Form Panel ═══ */
.portal-login-form-pane {
    padding: 36px 32px;
    background: rgba(15, 0, 8, 0.4);
    align-self: center;
}

.portal-login-form-pane .portal-auth-head h2 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-family: 'Playfair Display', Georgia, serif;
}

.portal-login-form-pane .portal-auth-head p {
    margin: 6px 0 0;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}
/* ═══ Form Elements ═══ */
.portal-form-row {
    margin-bottom: 14px;
}

.portal-label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.65);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.portal-input,
.portal-textarea,
.portal-select {
    width: 100%;
    border: 1px solid rgba(240,216,117,0.18);
    border-radius: 12px;
    padding: 11px 14px;
    background: rgba(10, 0, 3, 0.5);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: border-color 250ms ease, box-shadow 250ms ease, background 250ms ease;
    outline: none;
}

.portal-input::placeholder,
.portal-textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

.portal-input:focus,
.portal-textarea:focus,
.portal-select:focus {
    border-color: rgba(212,175,55,0.5);
    background: rgba(10, 0, 3, 0.7);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

.portal-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ═══ Buttons ═══ */
.portal-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease, background 200ms ease;
    position: relative;
    overflow: hidden;
}

.portal-btn:hover {
    transform: translateY(-1px);
}

.portal-btn:active {
    transform: translateY(0);
}

.portal-btn-primary {
    color: #1a0008;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    box-shadow: 0 4px 16px rgba(212,175,55,0.25);
}

.portal-btn-primary:hover {
    box-shadow: 0 6px 24px rgba(212,175,55,0.35);
    filter: brightness(1.05);
}

.portal-btn-secondary {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(240,216,117,0.2);
}

.portal-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(240,216,117,0.35);
    color: #fff;
}

.portal-btn-danger {
    color: #fff;
    background: rgba(182, 56, 71, 0.85);
    border: 1px solid rgba(220, 80, 90, 0.3);
}

.portal-btn-danger:hover {
    background: rgba(182, 56, 71, 1);
}

/* ═══ Actions ═══ */
.portal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

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

/* ═══ Divider ═══ */
.portal-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
}

.portal-login-divider div {
    height: 1px;
    background: rgba(240,216,117,0.15);
    flex: 1;
}

.portal-login-divider span {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* ═══ Inline Checkbox ═══ */
.portal-inline-check {
    color: rgba(255,255,255,0.6);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-inline-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

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

/* ═══ Alerts ═══ */
.portal-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.portal-alert-success {
    background: rgba(16, 130, 70, 0.15);
    border: 1px solid rgba(16, 130, 70, 0.3);
    color: #6ee7a8;
}

.portal-alert-danger {
    background: rgba(182, 56, 71, 0.12);
    border: 1px solid rgba(182, 56, 71, 0.3);
    color: #f5a0ab;
}

.portal-list {
    margin: 0;
    padding-left: 16px;
}

.portal-list li {
    margin: 2px 0;
}

/* ═══ Shell & Cards ═══ */
.portal-shell {
    width: min(1100px, calc(100% - 1.5rem));
    margin: 20px auto 28px;
}

.portal-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(240,216,117,0.12);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 44px rgba(0,0,0,0.28);
    border-color: rgba(240,216,117,0.25);
}

.portal-title {
    margin: 0 0 6px;
    font-size: clamp(1.3rem, 2.4vw, 1.9rem);
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
}

.portal-subtitle {
    margin: 0;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
}

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

/* ═══ KPI ═══ */
.portal-kpi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.portal-kpi .item {
    border: 1px solid rgba(240,216,117,0.15);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    padding: 14px;
}

.portal-kpi .item h3 {
    margin: 0;
    color: var(--gold-light);
    font-size: 1.4rem;
}

/* ═══ Table ═══ */
.portal-table-wrap {
    overflow-x: auto;
}

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

.portal-table th,
.portal-table td {
    text-align: left;
    border-bottom: 1px solid rgba(240,216,117,0.1);
    padding: 10px 12px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.8);
}

.portal-table th {
    color: var(--gold-light);
    background: rgba(255,255,255,0.04);
    font-weight: 600;
}

/* ═══ Animations ═══ */
@keyframes portalFadeSlide {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes portalPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes portalOrbitDot {
    0% { transform: translateX(-50%) rotate(0deg) translateX(150px) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg) translateX(150px) rotate(-360deg); }
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .portal-grid,
    .portal-kpi {
        grid-template-columns: 1fr;
    }

    .portal-login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .portal-login-info {
        padding: 28px 24px;
    }

    .portal-login-form-pane {
        padding: 24px 22px;
    }

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

    .portal-login-orbit {
        width: 200px;
        height: 200px;
        right: -60px;
        bottom: -60px;
    }
}

@media (max-width: 480px) {
    .portal-auth-wrap {
        padding: 12px 8px;
    }

    .portal-login-info h1 {
        font-size: 1.6rem;
    }

    .portal-login-form-pane .portal-auth-head h2 {
        font-size: 22px;
    }
}
