/* ==========================================================================
   BENTO ARCHITECTURE: AUTHENTIC REFERENCE IMPLEMENTATION
   منصة التقويم الفعال لمادة الرياضيات - الإدارة العامة للتعليم بمنطقة القصيم
   Two-Column Bento: Left Hero Artwork | Right Form + Bottom Credential Inset
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800&family=Vazirmatn:wght@700;800;900&display=swap');

:root {
    /* Brand Colors (WCAG AA Compliant >= 4.5:1) */
    --brand-navy: #013543;
    --brand-navy-light: #0C4D5E;
    --brand-blue: #005FB8;             /* Contrast 5.2:1 against white */
    --brand-blue-hover: #004D96;
    --brand-blue-focus: rgba(0, 95, 184, 0.22);

    /* Primary Action Button Tokens */
    --btn-primary-bg: #005FB8;
    --btn-primary-bg-hover: #004D96;
    --btn-primary-text: #FFFFFF;
    --btn-primary-shadow: 0 4px 14px rgba(0, 95, 184, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Avatar Colors (Contrast >= 4.5:1 with white text) */
    --avatar-purple: #6D28D9;          /* 6.3:1 */
    --avatar-emerald: #065F46;         /* 5.5:1 */
    --avatar-amber: #92400E;           /* 4.8:1 */

    /* Surfaces - Light Mode */
    --bg-page: #E2E8F0;
    --card-master-bg: #FFFFFF;
    --card-master-border: rgba(255, 255, 255, 0.8);
    --card-master-shadow: 0 25px 60px -12px rgba(1, 53, 67, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);

    --bottom-pill-bg: #F8FAFC;
    --bottom-pill-border: #E2E8F0;

    --text-primary: #0F172A;           /* Contrast 14.8:1 */
    --text-secondary: #334155;         /* Contrast 7.2:1 */
    --text-muted: #64748B;             /* Contrast 4.6:1 */

    /* Inputs */
    --input-bg: #F8FAFC;
    --input-border: #CBD5E1;
    --input-border-hover: #94A3B8;
    --input-focus: var(--brand-blue);
    --input-focus-ring: 0 0 0 3.5px var(--brand-blue-focus);

    /* Typography */
    --font-arabic: 'IBM Plex Sans Arabic', -apple-system, sans-serif;
    --font-heading: 'Vazirmatn', sans-serif;
    --font-latin: 'IBM Plex Sans', -apple-system, sans-serif;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
    --bg-page: #060911;
    --card-master-bg: #0F172A;
    --card-master-border: rgba(255, 255, 255, 0.08);
    --card-master-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);

    --bottom-pill-bg: #1E293B;
    --bottom-pill-border: #334155;

    --brand-blue: #38BDF8;
    --brand-blue-hover: #7DD3FC;
    --brand-blue-focus: rgba(56, 189, 248, 0.25);

    --btn-primary-bg: #38BDF8;
    --btn-primary-bg-hover: #7DD3FC;
    --btn-primary-text: #060911;       /* Contrast 11.2:1 against #38BDF8 - WCAG AAA */
    --btn-primary-shadow: 0 4px 18px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --input-bg: #1E293B;
    --input-border: #334155;
    --input-border-hover: #475569;
    --input-focus-ring: 0 0 0 3.5px rgba(56, 189, 248, 0.25);
}

/* Browser Surfaces */
::selection {
    background-color: var(--brand-blue);
    color: #FFFFFF;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #243048;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--bg-page);
    color: var(--text-primary);
    caret-color: var(--brand-blue);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 20px;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Background Subtle Mesh (Like Reference Soft Glow) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(13, 153, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(1, 53, 67, 0.08) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] body::before {
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(12, 77, 94, 0.12) 0%, transparent 45%);
}

/* ==========================================================================
   TOP BAR (Status & Theme Toggle)
   ========================================================================== */
.bento-topbar {
    position: fixed;
    top: 18px;
    left: 28px;
    right: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    pointer-events: none;
}

.topbar-status-chip {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-master-bg);
    border: 1px solid var(--card-master-border);
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.topbar-status-chip .pulse-dot,
.live-stats-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    position: relative;
    flex-shrink: 0;
}

.topbar-status-chip .pulse-dot::after,
.live-stats-badge .pulse-dot::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: #10B981;
    opacity: 0.6;
    animation: topbarPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes topbarPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.9); opacity: 0; }
}

.theme-toggle-btn {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--card-master-bg);
    border: 1px solid var(--card-master-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.theme-toggle-btn:focus-visible {
    outline: none;
    box-shadow: var(--input-focus-ring);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   MASTER BENTO CARD (Matching the Uploaded Reference Image)
   ========================================================================== */
.bento-master-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    background: var(--card-master-bg);
    border: 1px solid var(--card-master-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--card-master-shadow);
    display: grid;
    grid-template-columns: 550px 1fr;
    gap: 20px;
    align-items: stretch;
    margin: 20px auto 10px;
    transition: all 0.25s ease;
}

/* Bottom Platform Stats Bar (Outside Card) */
.live-platform-stats-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    width: 100%;
    max-width: 1100px;
    margin: 10px auto 4px;
    padding: 13px 24px;
    background: var(--card-master-bg);
    border: 1px solid var(--card-master-border);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.live-stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    font-size: 12.5px;
    font-weight: 700;
    color: #047857;
}

[data-theme="dark"] .live-stats-badge {
    background: rgba(16, 185, 129, 0.16);
    color: #34D399;
}

.live-stats-divider {
    width: 1px;
    height: 24px;
    background: var(--card-master-border);
}

.live-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.live-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-stat-icon svg {
    width: 16px;
    height: 16px;
}

.live-stat-item.is-teachers .live-stat-icon {
    background: rgba(0, 95, 184, 0.1);
    color: #005FB8;
}
.live-stat-item.is-teachers .live-stat-value {
    color: #005FB8;
}

.live-stat-item.is-students .live-stat-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.live-stat-item.is-students .live-stat-value {
    color: #059669;
}

.live-stat-item.is-exams .live-stat-icon {
    background: rgba(99, 102, 241, 0.12);
    color: #4F46E5;
}
.live-stat-item.is-exams .live-stat-value {
    color: #4F46E5;
}

[data-theme="dark"] .live-stat-item.is-teachers .live-stat-icon,
[data-theme="dark"] .live-stat-item.is-teachers .live-stat-value {
    color: #60A5FA;
}

[data-theme="dark"] .live-stat-item.is-students .live-stat-icon,
[data-theme="dark"] .live-stat-item.is-students .live-stat-value {
    color: #34D399;
}

[data-theme="dark"] .live-stat-item.is-exams .live-stat-icon,
[data-theme="dark"] .live-stat-item.is-exams .live-stat-value {
    color: #818CF8;
}

.live-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.live-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   RIGHT SIDE (in RTL): THE HERO VISUAL PANEL (Matching Reference Left Panel)
   -------------------------------------------------------------------------- */
.bento-hero-panel {
    background: var(--brand-navy);
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bento-hero-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   LEFT SIDE (in RTL): FORM SECTION + BOTTOM STATS INSET PILL
   -------------------------------------------------------------------------- */
.bento-content-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 24px 10px 24px;
    text-align: right;
}

.form-container-block {
    display: flex;
    flex-direction: column;
    text-align: right;
}

/* Form Top Block (Side-by-Side Header Lockup) */
.form-header-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.app-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 95, 184, 0.08);
    border: 1px solid rgba(0, 95, 184, 0.15);
    color: var(--brand-blue);
    flex-shrink: 0;
}

[data-theme="dark"] .app-brand-mark {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.2);
}

.app-brand-mark svg {
    width: 24px;
    height: 24px;
}

.form-header-text {
    display: flex;
    flex-direction: column;
}

.portal-chip {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-blue);
    background: rgba(0, 95, 184, 0.08);
    border-radius: 6px;
    padding: 2px 8px;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

[data-theme="dark"] .portal-chip {
    background: rgba(56, 189, 248, 0.14);
}

.form-main-heading {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 3px;
    text-align: right;
}

.form-sub-heading {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.35;
    text-align: right;
    margin-bottom: 0;
}

/* Inputs (Pill-Rounded, Modern) */
.input-group {
    margin-bottom: 16px;
}

/* Compact form modifier for multi-field forms like Register */
.form-compact {
    justify-content: center;
    padding: 24px 28px;
}

.form-compact .form-header-lockup {
    margin-bottom: 14px;
}

.form-compact .input-group {
    margin-bottom: 11px;
}

.form-compact .input-label-row {
    margin-bottom: 4px;
}

.form-compact .bento-input {
    height: 44px;
}

.form-compact .bento-btn-primary {
    height: 46px;
    margin-top: 4px;
}

.form-compact .form-footer-box {
    margin-top: 10px;
}

.form-compact .bento-stats-inset {
    margin-top: 14px;
    padding: 10px 16px;
}

/* Balanced Spacing Variant for Login Page */
.form-login-balanced {
    padding: 36px 32px;
    justify-content: center;
}

.form-login-balanced .form-container-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-login-balanced .form-header-lockup {
    margin-bottom: 36px;
}

.form-login-balanced .input-group {
    margin-bottom: 24px;
}

.form-login-balanced .input-label-row {
    margin-bottom: 8px;
}

.form-login-balanced .bento-input {
    height: 52px;
}

.form-login-balanced .form-options-row {
    margin: 6px 0 30px;
}

.form-login-balanced .bento-btn-primary {
    height: 54px;
    font-size: 16px;
}

.form-login-balanced .form-footer-box {
    margin-top: 24px;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-prefix {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: color 0.18s ease;
}

.input-icon-prefix svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

.bento-input {
    width: 100%;
    height: 48px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 0 46px 0 16px;
    font-family: var(--font-arabic);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.bento-input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.bento-input:hover {
    border-color: var(--input-border-hover);
}

.bento-input.is-invalid {
    border-color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.04) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: figmaShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes figmaShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

.bento-input:focus {
    border-color: var(--input-focus);
    box-shadow: var(--input-focus-ring);
    background: var(--card-master-bg);
}

.bento-input:focus ~ .input-icon-prefix {
    color: var(--brand-blue);
}

.password-eye-btn {
    position: absolute;
    left: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.password-eye-btn:hover {
    color: var(--text-primary);
}

.password-eye-btn:focus-visible {
    outline: none;
    box-shadow: var(--input-focus-ring);
}

.password-eye-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

/* Options (Remember & Forgot) */
.form-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
    font-weight: 500;
}

.remember-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-blue);
    cursor: pointer;
    border-radius: 4px;
}

.remember-checkbox input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: var(--input-focus-ring);
}

.forgot-link {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
    text-underline-offset: 3px;
}

.forgot-link:hover {
    text-decoration: underline;
    color: var(--brand-blue-hover);
}

.forgot-link:focus-visible {
    outline: none;
    box-shadow: var(--input-focus-ring);
    border-radius: 4px;
}

/* Primary Pill Button (Matching Reference) */
.bento-btn-primary {
    width: 100%;
    height: 48px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 50px;              /* Pill shape matching reference */
    font-family: var(--font-arabic);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--btn-primary-shadow);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-btn-primary:hover {
    background: var(--btn-primary-bg-hover);
    box-shadow: 0 8px 22px rgba(0, 95, 184, 0.35);
    transform: translateY(-1.5px);
}

[data-theme="dark"] .bento-btn-primary:hover {
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.45);
}

.bento-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 95, 184, 0.25);
}

.bento-btn-primary:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3.5px var(--brand-blue-focus);
}

.bento-btn-primary svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: transform 0.18s ease;
}

.bento-btn-primary:hover svg {
    transform: translateX(-3px);
}

/* Registration Link */
.form-footer-box {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.form-footer-box a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
    margin-right: 4px;
    text-underline-offset: 3px;
}

.form-footer-box a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   BOTTOM INSET PILL: STATS & SOCIAL PROOF (Matching Reference Lower Inset)
   -------------------------------------------------------------------------- */
.bento-stats-inset {
    background: var(--bottom-pill-bg);
    border: none;
    border-radius: 18px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-top: 24px;
}

.bento-avatar-stack {
    display: flex;
    align-items: center;
    direction: ltr;
    flex-shrink: 0;
}

.bento-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    border: 2.5px solid var(--bottom-pill-bg);
    margin-right: -8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.bento-avatar-circle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.95;
}

.avatar-badr { background: var(--avatar-purple); }
.avatar-badriah { background: var(--avatar-emerald); }
.avatar-nafs { background: var(--avatar-amber); }

.bento-stats-info {
    text-align: right;
}

.stats-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.stats-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   FEEDBACK MODAL
   ========================================================================== */
.bento-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.bento-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.bento-modal-card {
    width: 90%;
    max-width: 420px;
    background: var(--card-master-bg);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-master-border);
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-header-row svg {
    width: 24px;
    height: 24px;
    color: #059669;
    stroke: currentColor;
    stroke-width: 2.5;
}

.modal-title-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-desc-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 22px;
}

.modal-actions-row {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    height: 42px;
    border-radius: 8px;
    font-family: var(--font-arabic);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.modal-btn-primary {
    background: var(--brand-blue);
    color: #FFFFFF;
}

.modal-btn-primary:hover {
    background: var(--brand-blue-hover);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--bottom-pill-border);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1040px) {
    .bento-master-card {
        grid-template-columns: 470px 1fr;
        max-width: 960px;
    }

    .live-platform-stats-bar {
        max-width: 960px;
    }

    .bento-content-side {
        padding: 18px 20px 8px 20px;
    }
}

@media (max-width: 880px) {
    body {
        padding: 16px 12px;
    }

    .bento-master-card {
        grid-template-columns: 1fr;
        border-radius: 14px;
        padding: 12px;
        max-width: 480px;
        margin: 10px auto;
    }

    .live-platform-stats-bar {
        max-width: 480px;
        border-radius: 14px;
        gap: 12px 16px;
        padding: 12px 16px;
    }

    .live-stats-divider {
        display: none;
    }

    .bento-hero-panel {
        min-height: unset;
        height: auto;
        aspect-ratio: 530 / 600;
        order: -1;
    }

    .bento-content-side,
    .form-login-balanced {
        padding: 20px 14px 8px 14px;
    }

    .form-login-balanced .form-container-block {
        flex: unset;
        justify-content: flex-start;
    }

    .form-login-balanced .form-header-lockup {
        margin-bottom: 18px;
    }

    .form-login-balanced .input-group {
        margin-bottom: 14px;
    }

    .form-login-balanced .bento-input {
        height: 46px;
    }

    .form-login-balanced .form-options-row {
        margin: 0 0 16px;
    }

    .form-login-balanced .bento-btn-primary {
        height: 44px;
    }

    .form-login-balanced .bento-stats-inset {
        margin-top: 18px;
        padding: 10px 14px;
    }

    .bento-topbar {
        position: static;
        margin-bottom: 12px;
        width: 100%;
        max-width: 480px;
        padding: 0;
    }
}

@media (max-width: 560px) {
    body {
        padding: 12px 8px;
    }

    .bento-master-card {
        padding: 10px;
        border-radius: 12px;
    }

    .live-platform-stats-bar {
        border-radius: 12px;
    }

    .bento-hero-panel {
        border-radius: 9px;
    }

    .bento-hero-panel img {
        border-radius: 9px;
    }

    .form-header-lockup {
        gap: 12px;
        margin-bottom: 18px;
    }

    .app-brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .form-main-heading {
        font-size: 21px;
    }

    .form-sub-heading {
        font-size: 12.5px;
    }

    .input-group {
        margin-bottom: 13px;
    }

    .bento-input {
        height: 44px;
        font-size: 13.5px;
    }

    .form-options-row {
        margin-bottom: 16px;
        font-size: 12.5px;
    }

    .bento-btn-primary {
        height: 44px;
        font-size: 14.5px;
    }

    .bento-stats-inset {
        margin-top: 18px;
        padding: 10px 14px;
        gap: 10px;
    }

    .bento-avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .stats-title {
        font-size: 12px;
    }

    .stats-desc {
        font-size: 10.5px;
    }
}


/* Error Alert Banner */
.auth-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #DC2626;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    animation: figmaShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

[data-theme="dark"] .auth-error-banner {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #F87171;
}

.auth-error-banner svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}
