/* Trang đăng nhập (app/Views/auth/login.php) — trang độc lập, không dùng Bootstrap */

:root {
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
    --auth-bg: #f4f6fb;
    --auth-navy-1: #0b1224;
    --auth-navy-2: #111c3d;
    --auth-navy-3: #1e1b4b;
    --auth-indigo: #6366f1;
    --auth-sky: #0ea5e9;
    --auth-radius: 14px;
}

*,
*::before,
*::after { box-sizing: border-box; }

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-ink);
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ===================== Bên trái: thương hiệu ===================== */
.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 44px 56px;
    color: #e2e8f0;
    background: linear-gradient(150deg, var(--auth-navy-1) 0%, var(--auth-navy-2) 55%, var(--auth-navy-3) 100%);
}

.auth-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
.auth-hero-glow--a {
    width: 420px; height: 420px;
    top: -120px; right: -80px;
    background: rgba(99, 102, 241, .45);
}
.auth-hero-glow--b {
    width: 360px; height: 360px;
    bottom: 40px; left: -140px;
    background: rgba(14, 165, 233, .28);
}

/* Mặt cắt carton sóng chạy ngang đáy */
.auth-flute {
    position: absolute;
    left: -2%;
    bottom: 64px;
    width: 104%;
    height: 150px;
    opacity: .18;
    pointer-events: none;
}
.auth-flute-liner,
.auth-flute-wave {
    fill: none;
    stroke: #c7d2fe;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.auth-hero > *:not(.auth-hero-glow):not(.auth-flute) { position: relative; z-index: 1; }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .02em;
    background: linear-gradient(135deg, var(--auth-indigo), var(--auth-sky));
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .7);
}
.auth-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .7);
}
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand-text strong { font-size: 1.05rem; font-weight: 700; color: #fff; }
.auth-brand-text small { font-size: .8rem; color: #94a3b8; }

.auth-hero-body { max-width: 560px; }

.auth-hero-title {
    margin: 0 0 32px;
    font-size: clamp(1.8rem, 2.6vw, 2.45rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
    text-wrap: balance;
}
.auth-hero-title span {
    display: block;
    text-wrap: balance;
    background: linear-gradient(90deg, #a5b4fc, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}
.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.auth-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #a5b4fc;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
}
.auth-features strong { display: block; font-weight: 600; color: #f1f5f9; }
.auth-features small { display: block; font-size: .88rem; color: #94a3b8; }

.auth-hero-foot { margin: 0; font-size: .8rem; color: #64748b; }

/* ===================== Bên phải: đăng nhập ===================== */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    animation: auth-rise .45s ease-out both;
}

/* Logo trong khung đăng nhập: chỉ hiện khi phần thương hiệu bên trái bị ẩn */
.auth-brand--compact { display: none; margin-bottom: 28px; }
.auth-brand--compact .auth-brand-text strong { color: var(--auth-ink); }
.auth-brand--compact .auth-brand-text small { color: var(--auth-muted); }

.auth-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.auth-subtitle {
    margin: 0 0 28px;
    color: var(--auth-muted);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: .9rem;
}
.auth-alert i { margin-top: 3px; flex-shrink: 0; }
.auth-alert code { font-size: .85em; }
.auth-alert--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.auth-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.auth-alert--info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.auth-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 12px 20px;
    border-radius: var(--auth-radius);
    border: 1px solid #dadce0;
    background: #fff;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 16px -8px rgba(15, 23, 42, .18);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.auth-google-btn:hover {
    transform: translateY(-1px);
    border-color: #c4c7cc;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 12px 24px -10px rgba(15, 23, 42, .28);
}
.auth-google-btn:active { transform: translateY(0); }
.auth-google-btn:focus-visible,
.auth-submit:focus-visible,
.auth-field input:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .45);
    outline-offset: 2px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 18px;
    color: var(--auth-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-field span { font-size: .88rem; font-weight: 500; color: #334155; }
.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--auth-ink);
    font: inherit;
    font-size: 16px; /* >= 16px để Safari iOS không tự zoom */
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input:focus { border-color: var(--auth-indigo); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); outline: none; }

.auth-submit {
    height: 50px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--auth-indigo), var(--auth-sky));
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, .8);
    transition: filter .15s ease;
}
.auth-submit:hover { filter: brightness(1.06); }

.auth-note {
    display: flex;
    gap: 10px;
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--auth-line);
    color: var(--auth-muted);
    font-size: .85rem;
}
.auth-note i { margin-top: 3px; color: var(--auth-indigo); }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ===================== Màn hình nhỏ: một cột ===================== */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-brand--compact { display: flex; }
    .auth-panel {
        align-items: center;
        padding: 48px 20px;
        background:
            radial-gradient(600px 280px at 50% -60px, rgba(99, 102, 241, .14), transparent 70%),
            var(--auth-bg);
    }
    .auth-card {
        padding: 28px 22px;
        border-radius: 18px;
        background: #fff;
        border: 1px solid var(--auth-line);
        box-shadow: 0 20px 40px -24px rgba(15, 23, 42, .25);
    }
}

/* Điện thoại: khung sát trên để bàn phím ảo không che nút */
@media (max-width: 575.98px) {
    .auth-panel { align-items: flex-start; }
}

@media (max-width: 380px) {
    .auth-panel { padding: 24px 12px; }
    .auth-card { padding: 24px 16px; }
    .auth-title { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-google-btn { transition: none; }
}
