/* =============================================
   Demo Auth — Midnight Luxe Theme
   Paleta: Obsidiana #0D0D12, Champán #C9A84C,
           Marfil #FAF8F5, Pizarra #2A2A35
   ============================================= */

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

:root {
    --rqt-cyan: #00E6FE;
    --rqt-carbon: #1A1A1A;
    --rqt-grafito: #262626;
    --rqt-white: #FFFFFF;
    --rqt-muted: #9E9E9E;
    --rqt-yellow: #FEF07D;

    --obsidian: var(--rqt-carbon);
    --champagne: var(--rqt-cyan);
    --ivory: var(--rqt-white);
    --slate: var(--rqt-grafito);
    --slate-light: #333333;
    --slate-dark: #141414;
    --glass: rgba(38, 38, 38, 0.7);
    --glass-border: rgba(0, 230, 254, 0.15);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 2rem;
    --radius-xl: 3rem;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(0, 230, 254, 0.12);
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--obsidian);
    color: var(--ivory);
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Noise overlay --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--slate);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--champagne);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1.5rem;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    background: var(--slate-dark);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid var(--glass-border);
}

/* --- Left panel (Brand) --- */
.login-brand {
    position: relative;
    background: linear-gradient(160deg, var(--obsidian) 0%, #14141e 50%, var(--slate-dark) 100%);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.brand-content {
    position: relative;
    z-index: 2;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--champagne);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--champagne);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.brand-title {
    margin-bottom: 1rem;
    line-height: 1.1;
}

.title-sans {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 3.2rem;
    color: var(--ivory);
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.title-serif {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 2.8rem;
    color: var(--rqt-cyan);
    letter-spacing: -0.01em;
    margin-top: -0.5rem;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: rgba(250, 248, 245, 0.5);
    line-height: 1.7;
    max-width: 320px;
    margin-bottom: 2.5rem;
}

.brand-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--champagne);
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(250, 248, 245, 0.3);
}

/* Decorative rings */
.brand-decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.deco-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.06);
}

.deco-ring-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -150px;
    animation: ring-spin 60s linear infinite;
}

.deco-ring-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -100px;
    border-color: rgba(201, 168, 76, 0.04);
    animation: ring-spin 45s linear infinite reverse;
}

.deco-ring-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -50px;
    transform: translateY(-50%);
    border-color: rgba(201, 168, 76, 0.08);
    animation: ring-spin 30s linear infinite;
}

@keyframes ring-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Right panel (Form) --- */
.login-form-panel {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--slate-dark);
    position: relative;
}

.login-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--glass-border), transparent);
}

.form-content {
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: var(--radius-md);
    color: var(--champagne);
    margin-bottom: 1.25rem;
}

.form-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--ivory);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.form-description {
    font-size: 0.85rem;
    color: rgba(250, 248, 245, 0.45);
    line-height: 1.6;
}

/* --- Alert --- */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

/* --- Google button --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--ivory);
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-google::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(234, 67, 53, 0.1) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-google:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.btn-google:hover::before {
    opacity: 1;
}

.btn-google:active {
    transform: translateY(0) scale(0.99);
}

.google-icon {
    flex-shrink: 0;
}

/* --- Divider --- */
.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
}

.form-divider span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(250, 248, 245, 0.25);
    white-space: nowrap;
}

/* --- Security info --- */
.security-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: rgba(250, 248, 245, 0.4);
}

.security-item svg {
    color: var(--champagne);
    opacity: 0.6;
    flex-shrink: 0;
}

/* --- Form footer --- */
.form-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
}

.form-footer p {
    font-size: 0.7rem;
    color: rgba(250, 248, 245, 0.2);
}

/* =============================================
   DASHBOARD PAGE
   ============================================= */
.page-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* --- Header --- */
.dash-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(13, 13, 18, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 2.5rem;
}

/* User pill in header */
.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.4rem 0.4rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    margin-right: 1.25rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rqt-white);
    letter-spacing: -0.01em;
}

.user-email {
    font-size: 0.62rem;
    color: var(--rqt-muted);
    font-weight: 500;
}

.user-avatar-sm,
.user-avatar-sm-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-sm-fallback {
    background: var(--rqt-cyan);
    color: var(--rqt-carbon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.header-nav {
    display: flex;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--champagne);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.logo-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--ivory);
}

.btn-logout {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 75, 75, 0.08);
    color: #FF4B4B;
    transition: all var(--transition);
    border: 1px solid rgba(255, 75, 75, 0.15);
}

.btn-logout:hover {
    background: #FF4B4B;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.3);
}

/* --- Main --- */
.dash-main {
    flex: 1;
    padding: 2rem;
}

.dash-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Welcome section --- */
.welcome-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* padding: 2.5rem 0; */
}

.welcome-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(201, 168, 76, 0.3);
    box-shadow: 0 0 24px rgba(201, 168, 76, 0.1);
}

.avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--champagne), #b8943e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--obsidian);
}

.avatar-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border-radius: 50%;
    border: 3px solid var(--obsidian);
    animation: pulse-dot 2s ease-in-out infinite;
}

.welcome-greeting {
    font-size: 0.85rem;
    color: rgba(250, 248, 245, 0.4);
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.welcome-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--ivory);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* --- Modules section --- */
.modules-section {
    padding: 2.5rem 0 3.5rem;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rqt-cyan);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 0.85rem;
    color: rgba(250, 248, 245, 0.4);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2.25rem;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition);
    overflow: hidden;
    height: 100%;
}

.module-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, var(--accent-color), transparent 70%);
    opacity: 0.03;
    transition: opacity var(--transition);
}

.module-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(201, 168, 76, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(201, 168, 76, 0.05);
}

.module-card:hover .module-card-glow {
    opacity: 0.08;
}

.module-icon-wrapper {
    margin-bottom: 2rem;
}

.module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(201, 168, 76, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-color);
    transition: all var(--transition);
}

.module-card:hover .module-icon {
    transform: scale(1.1);
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}

.module-content {
    flex: 1;
    margin-bottom: 2rem;
}

.module-name {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ivory);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.module-description {
    font-size: 0.88rem;
    color: rgba(250, 248, 245, 0.5);
    line-height: 1.6;
}

.module-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(250, 248, 245, 0.06);
    color: var(--champagne);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition);
}

.module-card:hover .module-footer {
    color: var(--ivory);
}

.module-launch {
    opacity: 0.7;
}

.module-card:hover .module-launch {
    opacity: 1;
}

/* --- Cards grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.info-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--transition);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: rgba(201, 168, 76, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(250, 248, 245, 0.06);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: var(--radius-sm);
    color: var(--champagne);
}

.card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ivory);
    letter-spacing: -0.01em;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(250, 248, 245, 0.3);
    font-weight: 500;
}

.field-value {
    font-size: 0.85rem;
    color: rgba(250, 248, 245, 0.8);
    word-break: break-all;
}

.field-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(250, 248, 245, 0.55);
}

/* --- Provider badge --- */
.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(66, 133, 244, 0.08);
    border: 1px solid rgba(66, 133, 244, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #93bbfc;
}

/* --- Status badge --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
}

.status-active {
    color: #86efac;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* --- Footer --- */
.dash-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.25rem 2rem;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    font-size: 0.72rem;
    color: rgba(250, 248, 245, 0.25);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .login-brand {
        padding: 2rem 2rem 1.5rem;
    }

    .title-sans {
        font-size: 2rem;
    }

    .title-serif {
        font-size: 2.4rem;
    }

    .brand-stats {
        gap: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .login-brand {
        padding: 1.75rem 1.5rem 1.25rem;
    }

    .login-form-panel {
        padding: 2rem 1.5rem;
    }

    .login-form-panel::before {
        display: none;
    }

    .title-sans {
        font-size: 1.6rem;
    }

    .title-serif {
        font-size: 2rem;
    }

    .brand-subtitle {
        font-size: 0.82rem;
    }

    .welcome-name {
        font-size: 1.5rem;
    }

    .header-inner {
        padding: 0.85rem 1.25rem;
    }

    .dash-main {
        padding: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }
}