/* ============================================================================
   Authentication Pages Stylesheet
   Matches the existing DT-Chat design system
   ============================================================================ */

:root {
    /* Corporate Brand Colors (Ark-inspired) */
    --ark-blue: #0f1f44;
    --ark-accent: #0b3d91;
    --ink: #101828;
    --white: #ffffff;

    /* Auth-specific colors */
    --auth-card-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(16, 24, 40, 0.18);
    --input-focus: #0b3d91;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
}

/* Background */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ark-blue) 0%, var(--ark-accent) 100%);
    z-index: -1;
}

.auth-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
}

/* Admin Banner */
.admin-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Main Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--auth-card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--ark-blue);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: #6b7280;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: var(--ark-accent);
}

.auth-tab.active {
    color: var(--ark-accent);
    border-bottom-color: var(--ark-accent);
}

/* Form Container */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Form Elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.form-group input {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--ink);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group small {
    font-size: 12px;
    color: #6b7280;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-bar-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-bar-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
}

.strength-text.weak {
    color: var(--error-color);
}

.strength-text.medium {
    color: var(--warning-color);
}

.strength-text.strong {
    color: var(--success-color);
}

.password-requirements {
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

/* Buttons */
.form-actions {
    margin-top: 8px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ark-accent) 0%, var(--ark-blue) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(11, 61, 145, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    animation: spin 1s linear infinite;
    font-size: 20px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

/* Footer */
.auth-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.auth-footer p {
    font-size: 13px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .form-group input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--ark-accent);
    outline-offset: 2px;
}
