/* =======================================================
   AUTH.CSS — Trang đăng nhập & đăng ký + shared components
   ======================================================= */

/* ── Role badges (dùng chung nhiều trang) ─────────────── */
.role-badge {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.role-user    { background: #EEF2FF; color: #4338CA; }
.role-manager { background: #FFF7ED; color: #C2410C; }
.role-admin   { background: #FEF2F2; color: #B91C1C; }

/* ── Star rating (dùng chung nhiều trang) ──────────────── */
.star-rating {
    display: flex;
    gap: 0.35rem;
    font-size: 1.9rem;
    cursor: pointer;
    user-select: none;
}
.star-rating .star {
    color: #D1D5DB;
    transition: color 0.15s, transform 0.1s;
    line-height: 1;
}
.star-rating .star.active,
.star-rating .star:hover,
.star-rating .star.hovered { color: #FBBF24; transform: scale(1.12); }

/* ═══════════════════════════════════════════════════════
   AUTH PAGE LAYOUT — Login & Register
   ═══════════════════════════════════════════════════════ */

.auth-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(rgba(18, 8, 2, 0.72), rgba(18, 8, 2, 0.72)),
        url('https://atm273446-s3user.vcos.cloudstorage.com.vn/dhdainam/asset/asset/fixed/jcp8yed1xqhwpu9j6hf520240528065111_thump.jpg')
        center / cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ── Glass card ────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(238, 77, 45, 0.28);
    border-radius: 24px;
    padding: 2.75rem 2.5rem;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06) inset,
        0 32px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(238, 77, 45, 0.08);
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Logo / branding ──────────────────────────────────── */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 4px 12px rgba(238,77,45,0.5));
}
.auth-logo-name {
    font-size: 1.75rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
}
.auth-logo-tagline {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.2rem;
    letter-spacing: 0.04em;
}

/* Orange accent bar under logo */
.auth-logo::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #EE4D2D, #FF8C42);
    border-radius: 2px;
    margin: 0.9rem auto 0;
}

/* ── Headings ──────────────────────────────────────────── */
.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.2rem;
}
.auth-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.84rem;
    margin-bottom: 1.6rem;
}

/* ── Alerts ────────────────────────────────────────────── */
.auth-alert {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #FCA5A5;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    display: none;
}
.auth-alert-success {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.38);
    color: #86EFAC;
}

/* ── Form fields ───────────────────────────────────────── */
.auth-field {
    margin-bottom: 1.05rem;
}
.auth-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.38rem;
}
.auth-field-wrap {
    position: relative;
}
.auth-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 0.72rem 1rem;
    color: #fff;
    font-size: 0.91rem;
    outline: none;
    transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}
.auth-field input:focus {
    border-color: #EE4D2D;
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.22);
}
.auth-field .has-toggle input {
    padding-right: 2.8rem;
}

/* Password eye toggle */
.auth-eye {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
    user-select: none;
    transition: color 0.15s;
    line-height: 1;
}
.auth-eye:hover { color: rgba(255, 255, 255, 0.75); }

/* ── Submit button ─────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 0.82rem;
    background: linear-gradient(135deg, #EE4D2D 0%, #FF8C42 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 0.65rem;
    letter-spacing: 0.02em;
    transition: opacity 0.2s, transform 0.18s, box-shadow 0.2s;
    box-shadow: 0 4px 22px rgba(238, 77, 45, 0.42);
}
.auth-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(238, 77, 45, 0.55);
}
.auth-btn:active:not(:disabled) { transform: translateY(0); }
.auth-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Footer links ──────────────────────────────────────── */
.auth-footer-text {
    text-align: center;
    margin-top: 1.3rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.45);
}
.auth-footer-text a {
    color: #FF8C42;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-footer-text a:hover { color: #EE4D2D; }

.auth-back {
    display: block;
    text-align: center;
    margin-top: 0.65rem;
    font-size: 0.77rem;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 0.2s;
}
.auth-back:hover { color: rgba(255, 255, 255, 0.65); }

/* ── Password strength bar ──────────────────────────────── */
.pw-strength {
    height: 3px;
    border-radius: 2px;
    margin-top: 0.45rem;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.35s, background-color 0.35s;
}

/* ── Shake on error ──────────────────────────────────────── */
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    18%      { transform: translateX(-7px); }
    36%      { transform: translateX(7px); }
    54%      { transform: translateX(-4px); }
    72%      { transform: translateX(4px); }
}
.auth-card.shake {
    animation: authShake 0.42s ease;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.4rem;
        border-radius: 18px;
    }
    .auth-logo-name { font-size: 1.5rem; }
    .auth-title     { font-size: 1.25rem; }
}
