@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.15);
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #2563eb;
    --error-bg: #fef2f2;
    --error-color: #dc2626;
    --error-border: #fecaca;
    --success-bg: #ecfdf5;
    --success-color: #059669;
    --success-border: #a7f3d0;
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --input-bg: #f8fafc;
    --input-bg-focus: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #0a1628;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ═══════════════════════════════════════════
   BACKGROUND
   ═══════════════════════════════════════════ */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.login-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.55) saturate(1.2);
    transform: scale(1.02);
    animation: bgZoom 30s ease-in-out infinite alternate;
}

@keyframes bgZoom {
    0% { transform: scale(1.02); }
    100% { transform: scale(1.08); }
}

/* Overlay gradient */
.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at center, rgba(10, 22, 40, 0.2) 0%, rgba(10, 22, 40, 0.6) 100%),
        linear-gradient(180deg, rgba(10, 22, 40, 0.1) 0%, rgba(10, 22, 40, 0.4) 100%);
    z-index: 1;
}

/* ═══════════════════════════════════════════
   AUTH CONTAINER
   ═══════════════════════════════════════════ */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════
   AUTH CARD (Glassmorphism)
   ═══════════════════════════════════════════ */
.auth-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* Subtle top accent */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 1.25rem 1.25rem 0 0;
}

/* ═══════════════════════════════════════════
   HEADER / LOGO
   ═══════════════════════════════════════════ */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 200px;
    max-height: 72px;
    object-fit: contain;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

/* ═══════════════════════════════════════════
   FORM STYLES
   ═══════════════════════════════════════════ */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--input-bg);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    border-color: var(--border-focus);
    background-color: var(--input-bg-focus);
    box-shadow: 0 0 0 3.5px var(--primary-light);
}

/* Password field wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 0.375rem;
}

.toggle-password:hover {
    color: var(--text-secondary);
    background: rgba(0,0,0,0.04);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══════════════════════════════════════════
   BUTTON
   ═══════════════════════════════════════════ */
.btn-login {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-hover) 0%, #2563eb 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-login:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-login:hover:not(:disabled) {
    box-shadow: 0 8px 25px -5px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px -3px rgba(37, 99, 235, 0.4);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-login span,
.btn-login .spinner {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    display: none;
    line-height: 1.5;
}

.alert.show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: alertSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error-color);
    border: 1px solid var(--error-border);
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-color);
    border: 1px solid var(--success-border);
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════ */
.spinner {
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 20px;
    height: 20px;
    animation: spin 0.7s linear infinite;
}

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

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-footer span {
    font-weight: 500;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
        max-width: 100%;
    }

    .auth-card {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 1rem;
    }

    .auth-logo {
        max-width: 160px;
    }

    .auth-title {
        font-size: 1.05rem;
    }

    .form-input {
        padding: 0.8rem 0.875rem;
        font-size: 1rem;
    }

    .btn-login {
        padding: 0.8rem 1.25rem;
    }
}

@media (max-height: 680px) {
    .auth-card {
        padding: 1.75rem 2rem 1.5rem;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}
