/* -------------------------------------------------------------------------- */
/* File: login.css
   Purpose: Styles for the StickerShock sign-in page.
   Responsibilities:
   - Full-screen dark gradient background.
   - Centered auth card with accessible focus styles.
   - Error banner toggled via URL hash (#err).
   Dependencies:
   - None (standalone stylesheet for login.html).
*/
/* -------------------------------------------------------------------------- */

:root {
    color-scheme: dark;
    --bg-1: #0a1020;
    --bg-2: #0e1640;
    --card: #111827;
    --card-border: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --primary: #2563eb;
    --primary-press: #1e4fd0;
    --error: #f87171;
    --input-bg: #0b1222;
    --ring: #3b82f6;
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: grid;
    place-items: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue",
        Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 80% -10%,
            rgba(37, 99, 235, 0.25),
            transparent 60%),
        radial-gradient(800px 400px at -10% 10%,
            rgba(99, 102, 241, 0.22),
            transparent 55%),
        linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

/* -------------------------------------------------------------------------- */
/* Card                                                                       */
/* -------------------------------------------------------------------------- */

.card {
    width: min(92vw, 380px);
    background: color-mix(in oklab, var(--card) 90%, white 0%);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(20px, 2.8vw, 24px);
    letter-spacing: 0.2px;
}

.sub {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}

/* -------------------------------------------------------------------------- */
/* Form                                                                       */
/* -------------------------------------------------------------------------- */

.field {
    margin-top: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #cbd5e1;
}

.input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text);
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.input:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Button                                                                     */
/* -------------------------------------------------------------------------- */

.btn {
    width: 100%;
    margin-top: 18px;
    height: 46px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.04s ease,
        background 0.15s ease;
    touch-action: manipulation;
}

.btn:active {
    transform: translateY(1px);
    background: var(--primary-press);
}

.btn:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Error banner (shown when URL hash == #err)                                 */
/* -------------------------------------------------------------------------- */

.error {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    font-size: 14px;
}

/* The body has id="err". When the URL is /login#err, :target matches body
   and this rule reveals the error banner. */
:target .error {
    display: block;
}

/* -------------------------------------------------------------------------- */
/* Small screens & reduced motion                                             */
/* -------------------------------------------------------------------------- */

@media (max-width: 380px) {
    .card {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}