/* CASHA_Management System — Login Page */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --secondary:     #8b5cf6;
    --accent:        #06b6d4;
    --emerald:       #10b981;
    --rose:          #f43f5e;
    --text-dark:     #0f172a;
    --text-body:     #334155;
    --text-muted:    #64748b;
    --text-faint:    #94a3b8;
    --border:        rgba(255,255,255,0.15);
    --radius:        16px;
    --ease:          cubic-bezier(0.16, 1, 0.3, 1);
}

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body.login-page {
    font-family: 'Prompt', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a0f1e;
}

/* ── Background ── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.login-bg__img {
    position: absolute;
    inset: 0;
    background: url('../img/erp_bg.png') center/cover no-repeat;
    opacity: 0.18;
}

.login-bg__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(99,102,241,0.35) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(139,92,246,0.25) 0%, transparent 60%),
        linear-gradient(160deg, #080c1a 0%, #0d1230 50%, #0a0f1e 100%);
}

.login-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orb 14s ease-in-out infinite alternate;
}

.login-bg__orb--1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, transparent 70%);
    top: -200px; left: -150px;
    animation-duration: 16s;
}

.login-bg__orb--2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, transparent 70%);
    bottom: -150px; right: -120px;
    animation-duration: 20s;
    animation-delay: -8s;
}

@keyframes orb {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, -25px) scale(1.08); }
}

/* ── Wrap ── */
.login-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: enter 0.7s var(--ease) both;
}

@keyframes enter {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Card ── */
.login-card {
    width: 100%;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 2.4rem 2.2rem;
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.1),
        0 24px 64px rgba(0,0,0,0.45),
        0 8px 24px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

/* Top rainbow accent */
.login-card__accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 100%;
    animation: flow 5s linear infinite;
    border-radius: 24px 24px 0 0;
}

@keyframes flow {
    from { background-position: 0% 0%; }
    to   { background-position: 300% 0%; }
}

/* ── Brand ── */
.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-brand__icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(99,102,241,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.login-brand__icon:hover {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 10px 30px rgba(99,102,241,0.6);
}

.login-brand__icon svg { width: 26px; height: 26px; }

.login-brand__name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.login-brand__name span {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand__sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    margin-top: 3px;
    font-weight: 400;
}

/* ── Divider ── */
.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    margin-bottom: 1.4rem;
}

/* ── Heading ── */
.login-heading {
    margin-bottom: 1.6rem;
}

.login-heading h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 3px;
}

.login-heading p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.38);
}

/* ── Fields ── */
.login-field {
    margin-bottom: 1rem;
}

.login-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field__wrap input {
    width: 100%;
    height: 48px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0 44px 0 42px;
    color: #f1f5f9;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-field__wrap input::placeholder {
    color: rgba(255,255,255,0.2);
}

.login-field__wrap input:hover:not(:focus) {
    border-color: rgba(255,255,255,0.2);
}

.login-field__wrap input:focus {
    border-color: rgba(99,102,241,0.7);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.login-field__icon {
    position: absolute;
    left: 13px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
    width: 17px; height: 17px;
    transition: color 0.2s ease;
}

.login-field__wrap:focus-within .login-field__icon {
    color: rgba(99,102,241,0.8);
}

.login-field__eye {
    position: absolute;
    right: 10px;
    width: 30px; height: 30px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.login-field__eye:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
}

.login-field__eye svg { width: 16px; height: 16px; }

/* ── Submit button ── */
.login-btn {
    width: 100%;
    height: 50px;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 20px rgba(99,102,241,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

/* Shimmer */
.login-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 55%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover:not(:disabled)::before { left: 160%; }

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99,102,241,0.55);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-btn svg { width: 17px; height: 17px; }

.login-btn.is-loading .login-btn__arrow { display: none !important; }
.login-btn__spinner { animation: spin 0.75s linear infinite; }

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

/* ── Footer ── */
.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.22);
}

.login-footer svg { width: 13px; height: 13px; }

/* ── Developer credit ── */
.login-dev {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
}

.login-dev strong {
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}

.login-dev__sep {
    color: rgba(255,255,255,0.15);
}

.login-dev svg { width: 13px; height: 13px; color: rgba(99,102,241,0.6); }

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: rgba(15,23,42,0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 240px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    animation: toast-in 0.3s var(--ease) both;
    font-size: 0.82rem;
    font-weight: 500;
    color: #e2e8f0;
}

.toast--error   { border-left: 3px solid var(--rose); }
.toast--success { border-left: 3px solid var(--emerald); }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast--error   svg { color: var(--rose); }
.toast--success svg { color: var(--emerald); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast.out {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-wrap { padding: 1rem; }
    .login-card { padding: 1.8rem 1.5rem; border-radius: 20px; }
    .login-brand__name { font-size: 1.25rem; }
    .toast-container { left: 12px; right: 12px; bottom: 12px; }
    .toast { min-width: unset; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card__accent, .login-bg__orb, .login-btn__spinner { animation: none !important; }
}
