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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f4f5f7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── admin login uses dark background ── */
body.dark-bg {
    background: #0f0f0f;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

/* dark card variant (admin login) */
.card.dark-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
    box-shadow: none;
    max-width: 380px;
}

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo p {
    font-size: 14px;
    margin-top: 6px;
}

.logo p.dark-sub { color: #666; }
.logo p.light-sub { color: #6b7280; }

.logo .brand {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.logo .brand span { color: #2563eb; }

.form-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

label.dark-label { color: #999; }
label.light-label { color: #374151; font-weight: 500; margin-bottom: 6px; }

input {
    width: 100%;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input.dark-input {
    background: #111;
    border: 1px solid #2a2a2a;
    color: #fff;
}

input.dark-input:focus { border-color: #444; }

input.light-input {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    transition: border-color .2s;
    font-family: inherit;
    padding: 12px 14px;
}

input.light-input:focus { border-color: #2563eb; background: #fff; }

.error {
    border-radius: 10px;
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.error.dark-error {
    background: #2a1515;
    border: 1px solid #5a2020;
    color: #ff6b6b;
}

.error.light-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

button {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
}

button.dark-btn {
    background: #fff;
    color: #000;
}

button.light-btn {
    background: #111827;
    color: #fff;
    font-family: inherit;
}

button:hover { opacity: 0.9; }
button.light-btn:hover { opacity: .88; }

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.65s linear infinite;
    flex-shrink: 0;
}

button.dark-btn.btn-loading::after {
    border-color: rgba(0,0,0,0.2);
    border-top-color: #000;
}

.footer-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: #6b7280;
}

.footer-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover { text-decoration: underline; }

.hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    color: #fff;
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: all .2s;
    pointer-events: none;
    z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.info { background: #374151; }
