/* Login — black, ivory-white, two fields. */

:root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --ink: #f4f1ea;
    --muted: #7d7a72;
    --line: #2a2926;
    --field: #141413;
    --bad: #ef8a7b;
    --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.4 -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.login {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: rise 0.7s var(--ease) both;
}

.mark { display: block; width: 232px; height: auto; margin-bottom: 32px; user-select: none; -webkit-user-drag: none; }

h1 {
    margin: 0 0 44px;
    font: 400 32px/1 ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, serif;
    letter-spacing: 0.36em;
    text-indent: 0.36em; /* re-centres the tracked word */
    text-transform: uppercase;
}

form { width: 100%; display: flex; flex-direction: column; gap: 12px; }

input[type="text"], input[type="password"] {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: 17px; /* 16px+ so iOS never zooms on focus */
    text-align: center;
    letter-spacing: 0.04em;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder { color: var(--muted); }
input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(244, 241, 234, 0.08); }
/* Keep autofilled fields on-palette instead of the browser's yellow/blue. */
input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 100px var(--field) inset;
    caret-color: var(--ink);
}

button {
    height: 56px;
    margin-top: 4px;
    border: 0;
    border-radius: 16px;
    background: var(--ink);
    color: var(--bg);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.12s var(--ease), opacity 0.2s;
}
button:active { transform: scale(0.98); opacity: 0.9; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.err { min-height: 18px; margin: 0; font-size: 13px; color: var(--bad); }
.err:empty { min-height: 0; margin-top: -12px; }

.note { margin: 0; font-size: 14px; color: var(--muted); }
.note code { font: 13px ui-monospace, "SF Mono", Consolas, monospace; color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
    .login { animation: none; }
}
