/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg: hsl(155, 24%, 96%);          /* Soft Mint Background */
    --color-surface: hsl(0, 0%, 100%);        /* Pure White Card Background */
    --color-card-bg: hsl(155, 25%, 90%);     /* Pastel Teal Card Background */
    --color-text-primary: hsl(155, 45%, 9%);  /* Deep Slate Text */
    --color-text-secondary: hsl(155, 12%, 35%); /* Medium Slate Text */
    --color-primary: hsl(155, 40%, 25%);      /* Darker Teal Accent */
    --color-accent: hsl(11, 95%, 60%);        /* Red-Orange Primary Action */
    --color-accent-hover: hsl(11, 95%, 52%);  /* Darker Red-Orange */
    --color-mint-light: hsl(155, 35%, 94%);   /* Very light mint */
    --color-border: hsl(155, 20%, 88%);       /* Subtle borders */
    
    /* Layout & Spacing */
    --container-width: 1200px;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --box-shadow-soft: 0 10px 30px -10px hsla(155, 45%, 9%, 0.06);
    --box-shadow-hover: 0 20px 40px -15px hsla(155, 45%, 9%, 0.12);
}

/* ==========================================================================
   Global Resets
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   Login Pages – Shared Styles
   ========================================================================== */

/* ── Animated Background ─────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        hsl(155, 24%, 96%) 0%,
        hsl(155, 35%, 92%) 40%,
        hsl(155, 28%, 94%) 100%
    );
}

/* Subtle grid overlay */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ── Floating Particles ──────────────────────────────────────────────────── */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 18s infinite ease-in-out;
}

.particle:nth-child(1) {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, hsla(155, 40%, 60%, 0.12), transparent 70%);
    top: 10%;
    left: 15%;
    animation-delay: 0s;
    animation-duration: 22s;
}

.particle:nth-child(2) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, hsla(11, 95%, 60%, 0.06), transparent 70%);
    top: 60%;
    right: 10%;
    animation-delay: 4s;
    animation-duration: 26s;
}

.particle:nth-child(3) {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, hsla(155, 45%, 50%, 0.1), transparent 70%);
    bottom: 15%;
    left: 40%;
    animation-delay: 8s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, hsla(180, 40%, 55%, 0.08), transparent 70%);
    top: 30%;
    right: 30%;
    animation-delay: 2s;
    animation-duration: 24s;
}

.particle:nth-child(5) {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, hsla(155, 50%, 45%, 0.1), transparent 70%);
    top: 75%;
    left: 10%;
    animation-delay: 6s;
    animation-duration: 19s;
}

@keyframes floatParticle {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0) scale(0.8);
    }
    20% {
        opacity: 1;
    }
    50% {
        transform: translate(40px, -30px) scale(1.1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-20px, 40px) scale(0.8);
    }
}

/* ── Logo / Branding ─────────────────────────────────────────────────────── */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.login-logo .logo-icon {
    background-color: var(--color-text-primary);
    color: var(--color-surface);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.login-logo .logo-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

/* ── Gate Card (Glassmorphism) ────────────────────────────────────────────── */
.gate {
    position: relative;
    z-index: 1;
    background: hsla(0, 0%, 100%, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 48px 40px 40px;
    border-radius: var(--border-radius-lg, 24px);
    box-shadow:
        0 20px 60px -15px hsla(155, 45%, 9%, 0.08),
        0 0 0 1px hsla(155, 20%, 88%, 0.5);
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(30px);
    opacity: 0;
}

@keyframes cardReveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ── Badge / Tag ─────────────────────────────────────────────────────────── */
.gate-badge {
    display: inline-block;
    background-color: var(--color-surface, #fff);
    color: var(--color-text-secondary, #546e61);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border, hsl(155, 20%, 88%));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* ── Typography ──────────────────────────────────────────────────────────── */
.gate h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.gate-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ── Form Controls ───────────────────────────────────────────────────────── */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    padding-right: 48px;
    border: 1.5px solid var(--color-border, hsl(155, 20%, 88%));
    border-radius: var(--border-radius-sm, 8px);
    font-size: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--color-text-primary);
    background: hsla(0, 0%, 100%, 0.6);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    outline: none;
}

.input-group input::placeholder {
    color: hsla(155, 12%, 35%, 0.5);
}

.input-group input:focus {
    border-color: var(--color-primary, hsl(155, 40%, 25%));
    box-shadow: 0 0 0 4px hsla(155, 40%, 25%, 0.08);
    background: hsla(0, 0%, 100%, 0.9);
}

/* Input icon */
.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(calc(-50% + 10px));
    color: var(--color-text-secondary);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

.input-group input:focus ~ .input-icon {
    opacity: 0.7;
    color: var(--color-primary);
}

/* ── Primary Button (Accent) ─────────────────────────────────────────────── */
.gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 28px;
    border: none;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.gate-btn-primary {
    background-color: var(--color-accent, hsl(11, 95%, 60%));
    color: var(--color-surface, #fff);
    box-shadow: 0 6px 20px rgba(255, 90, 54, 0.25);
}

.gate-btn-primary:hover {
    background-color: var(--color-accent-hover, hsl(11, 95%, 52%));
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 90, 54, 0.35);
}

.gate-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 90, 54, 0.2);
}

/* Button shimmer effect */
.gate-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        hsla(0, 0%, 100%, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.gate-btn-primary:hover::after {
    left: 100%;
}

/* ── Dark / Accent Button ────────────────────────────────────────────────── */
.gate-btn-dark {
    background-color: var(--color-text-primary, hsl(155, 45%, 9%));
    color: var(--color-surface, #fff);
    box-shadow: 0 6px 20px hsla(155, 45%, 9%, 0.15);
}

.gate-btn-dark:hover {
    background-color: var(--color-primary, hsl(155, 40%, 25%));
    transform: translateY(-2px);
    box-shadow: 0 8px 28px hsla(155, 45%, 9%, 0.22);
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.gate-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.6;
}

.gate-divider::before,
.gate-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ── Footer Link ─────────────────────────────────────────────────────────── */
.gate-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border, hsl(155, 20%, 88%));
}

.gate-footer a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.gate-footer a:hover {
    color: var(--color-accent, hsl(11, 95%, 60%));
}

.gate-footer a .arrow {
    display: inline-block;
    transition: transform 0.3s;
}

.gate-footer a:hover .arrow {
    transform: translateX(4px);
}

/* ── Error message ───────────────────────────────────────────────────────── */
.gate-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm, 8px);
    background: hsla(0, 80%, 60%, 0.08);
    border: 1px solid hsla(0, 80%, 60%, 0.15);
    color: hsl(0, 65%, 48%);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    animation: shakeError 0.4s ease;
}

.gate-error.visible {
    display: flex;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Loading Spinner on Button ───────────────────────────────────────────── */
.gate-btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.gate-btn.loading .spinner {
    display: inline-block;
}

.gate-btn.loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Back to Home Link ───────────────────────────────────────────────────── */
.back-home {
    position: absolute;
    top: 32px;
    left: 32px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    opacity: 0;
    animation: fadeIn 0.6s 0.5s forwards;
}

.back-home:hover {
    color: var(--color-text-primary);
}

.back-home:hover svg {
    transform: translateX(-3px);
}

.back-home svg {
    transition: transform 0.3s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .gate {
        padding: 36px 28px 28px;
        border-radius: var(--border-radius-md, 16px);
    }

    .gate h2 {
        font-size: 1.5rem;
    }

    .back-home {
        top: 20px;
        left: 20px;
    }
}
