/* ============ AUTHENTICATION STYLES - QUARTZ ENTERPRISE ============ */
@font-face {
    font-family: 'Avenir Next LT Pro';
    src: url('Fonts/Avenir Next LT Pro Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Local Overrides or Extensions if needed */
    --auth-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-accent) 100%);
}

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

body {
    font-family: 'Avenir Next LT Pro', sans-serif;
    background: var(--auth-bg);
    background-attachment: fixed;
    color: var(--neutral-900);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ TYPOGRAPHY SYSTEM ============ */
h1 {
    font-size: var(--font-h1);
    font-weight: var(--weight-black);
    line-height: var(--lh-tight);
    letter-spacing: -0.04em;
}

h2 {
    font-size: var(--font-h2);
    font-weight: var(--weight-bold);
    line-height: var(--lh-tight);
}

h3 {
    font-size: var(--font-h3);
    font-weight: var(--weight-bold);
    line-height: var(--lh-tight);
}

p {
    font-size: var(--font-body);
    line-height: var(--lh-standard);
    color: var(--neutral-600);
}

.caption {
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    color: var(--neutral-400);
}

/* ============ AUTH CONTAINER ============ */
.auth-container {
    width: 100%;
    max-width: 480px;
    padding: var(--space-24);
}

.auth-card {
    background: #ffffff;
    padding: var(--space-48);
    border-radius: var(--radius-24);
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-standard);
}

/* ============ BRANDING ============ */
.auth-brand {
    margin-bottom: var(--space-32);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
}

.brand-logo {
    height: 64px;
    margin-bottom: var(--space-8);
}

.brand-tagline {
    font-size: var(--font-micro);
    font-weight: var(--weight-bold);
    color: var(--neutral-400);
    letter-spacing: 0.12em;
}

/* ============ FORM STYLING ============ */
.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: var(--space-24);
}

.form-group label {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--weight-bold);
    color: var(--neutral-700);
    margin-bottom: var(--space-8);
    letter-spacing: 0.05em;
}

/* --- Input State System --- */
.form-group input {
    width: 100%;
    padding: var(--space-16);
    font-size: var(--font-h4);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-12);
    transition: var(--transition-standard);
    color: var(--neutral-900);
    font-family: inherit;
}

/* Focus State */
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Error State */
.form-group.error input {
    border-color: var(--danger-color);
    background: #fffafa;
}

.form-group.error input:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Disabled State */
.form-group input:disabled {
    background: var(--neutral-100);
    color: var(--neutral-400);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group input::placeholder {
    color: var(--neutral-300);
}

/* ============ OPTIONS & LINKS ============ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-32);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: var(--font-body);
    color: var(--neutral-600);
    cursor: pointer;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    accent-color: var(--primary-color);
}

.forgot-link {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* ============ BUTTON STATE SYSTEM ============ */
.btn {
    width: 100%;
    padding: var(--space-16);
    font-size: var(--font-h4);
    font-weight: var(--weight-bold);
    border-radius: var(--radius-12);
    cursor: pointer;
    transition: var(--transition-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    font-family: inherit;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

/* Hover & Focus */
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(104, 54, 149, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Disabled / Loading State */
.btn:disabled {
    background: var(--neutral-200);
    color: var(--neutral-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner Indicator */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============ ERROR MESSAGES ============ */
.error-container {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: var(--space-12);
    border-radius: var(--radius-8);
    margin-bottom: var(--space-24);
    display: none;
    /* Hidden by default */
}

.error-container.active {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.error-text {
    color: #991b1b;
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
}

/* ============ FOOTER ============ */
.auth-footer {
    margin-top: var(--space-48);
    font-size: var(--font-body);
    color: var(--neutral-500);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--weight-bold);
    transition: var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    .auth-container {
        padding: 0;
    }

    .auth-card {
        border-radius: 0;
        min-height: 100vh;
        padding: var(--space-48) var(--space-24);
    }
}

/* ============ CORNER GIF ============ */
.corner-gif {
    position: fixed;
    bottom: var(--space-48);
    right: var(--space-48);
    width: 240px;
    z-index: 50;
    pointer-events: none;
    animation: float-premium 8s ease-in-out infinite;
    animation-fill-mode: forwards;
}

.corner-gif img {
    width: 100%;
    height: auto;
}

@keyframes float-premium {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .corner-gif {
        width: 160px;
        bottom: var(--space-24);
        right: var(--space-24);
    }
}

@media (max-width: 768px) {
    .corner-gif {
        display: none;
        /* Hide on smaller screens to keep focus on the login form */
    }
}