/* Login Page Styles - Split Layout
 * Two-column design: Hero image left, login form right
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Blue Scale */
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;

    /* Gray Scale */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #ebebeb;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;

    /* Cyan/Teal for accent */
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;

    /* Green Scale */
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-700: #15803d;

    /* Red Scale */
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-700: #b91c1c;

    /* Semantic Colors */
    --color-primary: #0ea5e9;
    --color-white: white;
    --shadow-focus: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
}

/* ========================================
   Font Face - Inter (local TTF files)
   ======================================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter/inter-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/inter/inter-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter/inter-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter/inter-700.ttf') format('truetype');
}

/* ========================================
   Split Layout Container
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%),
        url('https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920&q=80') center/cover no-repeat fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-page-split {
    display: flex;
    width: 100%;
    max-width: 900px;
    min-height: 540px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================
   Left Column: Hero Image
   ======================================== */
.login-hero {
    flex: 0 0 30%;
    max-width: 30%;
    position: relative;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%),
        url('https://images.unsplash.com/photo-1519681393784-d120267933ba?w=800&q=80') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2rem;
    overflow: hidden;
}

/* Dark overlay for text readability */
.login-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}

/* Hero brand - top of column */
.login-hero-brand {
    position: relative;
    z-index: 4;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Hero title - centered in column */
.login-hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-hero-title-emphasis {
    font-size: 1.5em;
    display: block;
}

/* ========================================
   Right Column: Login Form
   ======================================== */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    background: white;
}

.login-form-wrapper {
    width: 100%;
    max-width: 480px;
}

.login-form-container {
    background: transparent;
    padding: 0;
}

.login-welcome {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 0.5rem 0;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin: 0 0 2rem 0;
}

/* ========================================
   Alert Styles
   ======================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.alert-success {
    background-color: var(--green-100);
    color: var(--green-700);
    border: 1px solid var(--green-200);
}

.alert-error {
    background-color: var(--red-100);
    color: var(--red-700);
    border: 1px solid var(--red-200);
}

.alert i, .alert svg {
    flex-shrink: 0;
}

/* ========================================
   Form Styles
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon.password-field .form-control {
    padding-right: 2.75rem;
}

.toggle-password {
    position: absolute;
    right: 0.875rem;
    color: var(--gray-400);
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--gray-600);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset;
    -webkit-text-fill-color: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.form-control::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    margin: 1.5rem 0 0 auto;
    padding: 0.75rem 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    background: #1a1a1a;
    color: var(--color-white);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    min-height: 2.5rem;
}

.btn .btn-text {
    display: block;
}

.btn:hover {
    background: #333;
}

.btn:active {
    background: #111;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--gray-400);
    box-shadow: none;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    color: var(--color-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.btn-block {
    /* Keep auto width, right-aligned */
}

/* ========================================
   Loading Dots Animation
   ======================================== */
.loading-dots {
    display: none !important;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-dots.show {
    display: flex !important;
}

.loading-dots .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: var(--color-white);
    animation: loginDotPulse 1.4s infinite ease-in-out;
    display: block;
    flex-shrink: 0;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loginDotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   MFA Verification Page Styles
   ======================================== */
.mfa-verify-container {
    padding: 1.5rem 2rem;
}

.mfa-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.mfa-subtitle strong {
    color: var(--gray-700);
    font-weight: 600;
}

.mfa-code-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    font-family: 'Courier New', monospace;
    padding: 1rem !important;
    text-transform: uppercase;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    background: var(--gray-50);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mfa-code-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: var(--shadow-focus);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

.mfa-trust-device {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-600);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.checkbox-label span {
    line-height: 1;
}

.mfa-form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mfa-action-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.mfa-divider {
    color: var(--gray-300);
    user-select: none;
}

.btn-link-small {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.btn-link-small:hover {
    color: #0284c7;
    text-decoration: underline;
}

.btn-link-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.backup-code-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

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

.backup-code-form .btn {
    width: 70%;
    max-width: 240px;
    margin: 0 auto 0.5rem auto;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 900px) {
    .login-page {
        padding: 1rem;
    }

    .login-page-split {
        flex-direction: column;
        min-height: auto;
    }

    .login-hero {
        flex: 0 0 auto;
        max-width: 100%;
        min-height: 160px;
        padding: 1.5rem;
        align-items: center;
        justify-content: flex-start;
    }

    .login-hero-brand {
        text-align: center;
        width: 100%;
    }

    .login-hero-title {
        font-size: 1.75rem;
    }

    .login-form-side {
        flex: 1;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-hero {
        min-height: 160px;
        padding: 1.5rem;
    }

    .login-hero-title {
        font-size: 1.5rem;
    }

    .login-form-side {
        padding: 1.5rem;
    }

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

    .form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.875rem;
        min-height: 2.25rem;
    }
}

/* ========================================
   Legacy Support (for non-split pages)
   ======================================== */
.login-container {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

.login-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--gray-700);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
    margin: 0 0 2rem 0;
    letter-spacing: -0.025em;
}
