/* ============================================================
   auth.css — Trang đăng nhập BMWMS
   Màu chủ đạo từ logo: Navy #1e3a6e, Blue #2563b8, Gray #6b7280
   ============================================================ */

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

:root {
    --navy:      #1e3a6e;
    --navy-dark: #152d57;
    --blue:      #2563b8;
    --blue-light:#3b82f6;
    --gray-100:  #f1f5f9;
    --gray-200:  #e2e8f0;
    --gray-400:  #94a3b8;
    --gray-600:  #475569;
    --gray-700:  #334155;
    --white:     #ffffff;
    --danger:    #dc2626;
    --warning:   #d97706;
    --success:   #16a34a;
}

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

.auth-body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2147 0%, #1e3a6e 40%, #2d5a9e 70%, #3b7dd8 100%);
    position: relative;
    overflow: hidden;
}

/* Animated background particles */
.auth-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    top: -200px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.auth-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    bottom: -100px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

/* ── Login Card ── */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: 20px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 48px 44px 40px;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ── Logo Section ── */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(30, 58, 110, 0.4);
}

.auth-logo-text {
    display: flex;
    flex-direction: column;
}

.auth-logo-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.auth-logo-sub {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* ── Title ── */
.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--gray-600);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Form Fields ── */
.auth-field {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
}

.auth-label span.required {
    color: var(--danger);
    margin-left: 2px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--gray-700);
    background: var(--gray-100);
    transition: all 0.2s ease;
    outline: none;
}

.auth-input:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 184, 0.12);
}

.auth-input::placeholder {
    color: var(--gray-400);
    font-size: 13.5px;
}

.auth-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--blue);
}

/* Password toggle */
.auth-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.auth-pw-toggle:hover { color: var(--navy); }

/* ── Forgot Password ── */
.auth-forgot {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 22px;
}

.auth-forgot a {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-forgot a:hover { color: var(--navy); text-decoration: underline; }

/* ── Login Button ── */
.auth-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(30, 58, 110, 0.4);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 58, 110, 0.5);
}

.auth-btn:active { transform: translateY(0); }

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

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

/* ── Alerts ── */
.auth-alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    border: none;
}

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

.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 3px solid var(--danger);
}

.auth-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 3px solid var(--warning);
}

.auth-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 3px solid var(--blue-light);
}

/* ── Footer note ── */
.auth-footer-note {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 12.5px;
    color: var(--gray-400);
    line-height: 1.6;
}

.auth-footer-note strong {
    color: var(--gray-600);
}

/* ── Input validation states ── */
.auth-input.is-invalid {
    border-color: var(--danger);
    background: #fff8f8;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    display: none;
}

/* Countdown badge */
.lockout-timer {
    display: inline-block;
    background: var(--warning);
    color: white;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 700;
    font-size: 13px;
}
