/* Login / forgot password / register (themes/default/admin/views/auth/login.php).
   Plain CSS (no Tailwind runtime). Palette: slate + indigo. Fonts/icons are local
   (assets/vendor-local), so the page works offline. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif; font-size: 14px; color: #0f172a; -webkit-font-smoothing: antialiased;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .35), transparent 60%),
                radial-gradient(900px 500px at 110% 110%, rgba(139, 92, 246, .30), transparent 60%),
                linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    background-attachment: fixed; overflow-x: hidden;
}
/* Soft floating glow shapes behind the card */
.auth-glow { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .45; pointer-events: none; z-index: 0; }
.auth-glow-1 { width: 340px; height: 340px; top: 8%; left: 12%; background: #6366f1; animation: auth-float 14s ease-in-out infinite; }
.auth-glow-2 { width: 280px; height: 280px; bottom: 6%; right: 10%; background: #8b5cf6; animation: auth-float 18s ease-in-out infinite reverse; }
@keyframes auth-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -24px); } }

/* ---- Card ---- */
.auth-card {
    position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 36px 36px 28px;
    background: #fff; border: 1px solid rgba(241, 245, 249, .9); border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(2, 6, 23, .55), 0 0 0 1px rgba(255, 255, 255, .04);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    animation: auth-enter .55s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes auth-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo img { max-height: 72px; max-width: 200px; object-fit: contain; transition: transform .3s ease; }
.auth-logo img:hover { transform: scale(1.04); }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1, .auth-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; line-height: 1.25; color: #0f172a; letter-spacing: -.01em; }
.auth-head p { margin: 0; font-size: 14px; color: #64748b; }
.auth-badge {
    width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: #eef2ff; color: #4f46e5; font-size: 20px;
}

/* ---- Alerts ---- */
.auth-alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.auth-alert i { margin-top: 2px; }
.auth-alert-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.auth-alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.auth-alert-info { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.auth-alert p { margin: 0; }

/* ---- Fields ---- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.auth-input {
    position: relative; display: flex; align-items: center; height: 48px; padding: 0 14px; gap: 10px;
    border: 1px solid #e2e8f0; border-radius: 12px; background: rgba(248, 250, 252, .6);
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.auth-input:hover { background: #fff; }
.auth-input:focus-within { background: #fff; border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(99, 102, 241, .18); }
.auth-input > i { flex: 0 0 auto; width: 16px; text-align: center; color: #94a3b8; transition: color .2s; }
.auth-input:focus-within > i { color: #4f46e5; }
.auth-input input {
    flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 14px; color: #0f172a;
}
.auth-input input::placeholder { color: #94a3b8; }
/* Browser autofill: keep the soft background instead of yellow/blue */
.auth-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: #0f172a; }
.auth-input.plain { padding: 0 14px; }
.auth-toggle {
    flex: 0 0 auto; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 8px; background: transparent;
    color: #94a3b8; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .2s, background .2s;
}
.auth-toggle:hover, .auth-toggle:focus { color: #4f46e5; background: #eef2ff; outline: 0; }
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Captcha */
.auth-captcha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.auth-captcha-img {
    position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px;
    border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; overflow: hidden;
}
.auth-captcha-img img { max-width: 100%; height: auto; display: block; }
.auth-captcha-reload {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .9); color: #64748b; font-size: 12px; text-decoration: none;
}
.auth-captcha-reload:hover { color: #4f46e5; }

/* Remember + forgot */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; cursor: pointer; user-select: none; }
.auth-check input { width: 16px; height: 16px; margin: 0; border-radius: 5px; accent-color: #4f46e5; cursor: pointer; }
.auth-link { font-size: 13px; font-weight: 600; color: #4f46e5; text-decoration: none; transition: color .15s; }
.auth-link:hover { color: #4338ca; text-decoration: underline; text-underline-offset: 3px; }
.auth-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #475569; line-height: 1.5; }
.auth-terms input { margin-top: 3px; width: 16px; height: 16px; accent-color: #4f46e5; }

/* ---- Buttons ---- */
.auth-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; padding: 0 20px;
    border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.auth-btn-primary {
    color: #fff; background: linear-gradient(90deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55);
}
.auth-btn-primary:hover { background: linear-gradient(90deg, #4338ca 0%, #3730a3 100%); transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(79, 70, 229, .6); }
.auth-btn-primary:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(99, 102, 241, .35); }
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary .fa-arrow-right { transition: transform .2s; }
.auth-btn-primary:hover .fa-arrow-right { transform: translateX(3px); }
.auth-btn[disabled] { opacity: .75; cursor: progress; transform: none; }
.auth-btn-ghost { color: #334155; background: #f1f5f9; }
.auth-btn-ghost:hover { background: #e2e8f0; color: #0f172a; }
.auth-actions { display: flex; gap: 12px; }
.auth-actions .auth-btn { flex: 1 1 0; }
.auth-alt { margin: 18px 0 0; text-align: center; font-size: 13px; color: #64748b; }
.auth-back { display: flex; justify-content: center; margin-top: 18px; }
.auth-back .auth-link { display: inline-flex; align-items: center; gap: 8px; }

/* ---- Footer ---- */
.auth-foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid #f1f5f9; text-align: center; }
.auth-foot p { margin: 0 0 8px; font-size: 12px; color: #94a3b8; }
.auth-foot a { color: #64748b; text-decoration: none; }
.auth-foot a:hover { color: #4f46e5; }
.auth-foot .auth-dev a { font-weight: 600; color: #4f46e5; }
.auth-social { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.auth-social a {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #f1f5f9; color: #64748b; font-size: 15px; transition: background .2s, color .2s, transform .2s;
}
.auth-social a:hover { background: #eef2ff; color: #4f46e5; transform: translateY(-2px); }

/* Panels (#login / #forgot_password / #register) */
.auth-panel[hidden] { display: none; }
.auth-panel.is-entering { animation: auth-panel .35s ease both; }
@keyframes auth-panel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
    body.auth { padding: 16px 12px; align-items: flex-start; }
    .auth-card { padding: 28px 20px 22px; border-radius: 18px; }
    .auth-grid-2, .auth-captcha { grid-template-columns: 1fr; }
    .auth-actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-card, .auth-panel.is-entering, .auth-glow { animation: none !important; }
    .auth-btn, .auth-logo img { transition: none; }
}
