/* Login + register: the form is a white sheet pulled from the Beatpax folder.
   Same world as templates/landing.html (see DESIGN.md). */
:root {
    --red: #d21a23;
    --tab: #ee4b45;
    --ink: #0a0a0a;
    --ground: #242424;          /* plain grey ground behind the dots */
    --paper: #ffffff;
    --paper-2: #f3f1ee;
    --line: #ddd8d2;
    --muted: #6b6b6b;
    --display: "Archivo", "Arial Black", Helvetica, sans-serif;
    --body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --spring: cubic-bezier(0.2, 1.35, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: clip; }

body {
    font-family: var(--body);
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.085) 1px, transparent 1.5px) 0 0 / 22px 22px,
        var(--ground);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 28px max(16px, env(safe-area-inset-left, 0px)) 56px;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.login-wrapper,
.register-wrapper {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

.logo-section { display: block; }
/* Wordmark: the hero face, set as one white block of type */
.logo-word {
    display: block;
    font-family: var(--display);
    font-stretch: 125%;
    font-weight: 900;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
}

/* The folder behind the sheet: back with tab, then the sheet, then nothing in front,
   so the whole form stays readable. */
.sheet-stack { position: relative; width: 100%; }
.auth-folder {
    position: absolute;
    inset: -22px -18px auto -18px;
    height: 220px;
    background: var(--tab);
    border-radius: 0 28px 28px 28px;
    transform: rotate(-4deg);
    animation: folderIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-folder::before {
    content: "";
    position: absolute;
    left: 0;
    top: -22px;
    width: 38%;
    height: 24px;
    background: var(--tab);
    border-radius: 18px 18px 0 0;
    clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}
.auth-folder::after {               /* the folder's front edge peeking below the tab */
    content: "";
    position: absolute;
    inset: 26px 0 0;
    background: var(--red);
    border-radius: 20px 28px 28px 28px;
}
@keyframes folderIn { from { opacity: 0; transform: translateY(24px) rotate(-8deg); } }

.glass-card {
    position: relative;
    background: var(--paper);
    border-radius: 14px 34px 18px 18px;
    padding: 34px 32px 30px;
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9);
    animation: sheetUp 0.8s var(--spring) 0.15s both;
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } }

.form-title {
    font-family: var(--display);
    font-stretch: 125%;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.error-message {
    background: #fde8e8;
    color: #8f1218;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="number"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: var(--paper-2);
    border: 1.5px solid transparent;
    border-radius: 10px;
    font: 400 15px var(--body);
    color: var(--ink);
    caret-color: var(--red);
    transition: border-color 0.15s, background 0.15s;
}
.form-group input::placeholder { color: #8a8580; }
.form-group input:focus { outline: none; background: #fff; border-color: var(--ink); }

.terms-agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.terms-agree input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex-shrink: 0; }
.terms-agree label { font-size: 13px; line-height: 1.5; color: #444; margin: 0; }
.terms-agree a { color: var(--ink); font-weight: 600; }

/* Submit = folder tab button */
.submit-button {
    position: relative;
    width: 100%;
    height: 50px;
    margin-top: 18px;
    border: none;
    border-radius: 0 12px 12px 12px;
    background: var(--red);
    color: #fff;
    font: 600 15px var(--body);
    cursor: pointer;
    transition: transform 0.25s var(--spring), background 0.15s;
}
.submit-button::before {
    content: "";
    position: absolute;
    left: 0;
    top: -10px;
    width: 34%;
    height: 12px;
    background: inherit;
    border-radius: 8px 8px 0 0;
    clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}
.submit-button:hover { background: #b9161e; transform: translateY(-1px); }
.submit-button:active { transform: translateY(1px) scale(0.99); }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #8a8580; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.register-link, .login-link { text-align: center; font-size: 14px; color: var(--muted); margin-top: 6px; }
.register-link a, .login-link a { color: var(--ink); font-weight: 600; }

.google-terms-notice { font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; margin: -6px 0 16px; }
.google-terms-notice a { color: var(--ink); }

@media (max-width: 480px) {
    .auth-folder { inset: -18px -6px auto -6px; }
    .glass-card { padding: 28px 20px 24px; }
    .form-title { font-size: 26px; }
}

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