/* Sign-in, sign-up, password reset and email confirmation, dressed as
   getperiscope.com is: the system typeface, ink on paper, and a button that is
   ink rather than brand colour. Loaded after styles.css and periscope-ui.css by
   those pages only, so it restates the shared tokens with the landing page's
   values and then styles the one card. */
:root {
    --ghost-white: #f1f5f6;
    --white: #ffffff;
    --surface: #ffffff;
    --headings: #0e1c24;
    --dark-slate-blue: #0e1c24;
    --slate-grey: #43545d;
    --muted: #62747d;
    --border-mute: #dde5e8;
    --border-subtle: #c3ced3;
    --border-strong: #c3ced3;
    --shadow-sm: 0 14px 34px -18px rgba(14, 28, 36, 0.2);
    --font-sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-alt: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --btn-bg: #0e1c24;
    --btn-bg-hover: #1f3743;
    --btn-fg: #ffffff;
    --page-top: #e6eff2;
    --page-bottom: #ffffff;
    --focus: rgba(14, 28, 36, 0.14);
}

:root[data-theme="dark"] {
    --ghost-white: #0e141c;
    --white: #121a23;
    --surface: #121a23;
    --headings: #f0f3f6;
    --dark-slate-blue: #f0f3f6;
    --slate-grey: #aab6bf;
    --muted: #7c8a94;
    --border-mute: #1d2731;
    --border-subtle: #2e3b47;
    --border-strong: #2e3b47;
    --shadow-sm: 0 16px 36px -16px rgba(0, 0, 0, 0.6);
    --btn-bg: #f0f3f6;
    --btn-bg-hover: #ffffff;
    --btn-fg: #0b1118;
    --page-top: #111c2e;
    --page-bottom: #080c13;
    --focus: rgba(240, 243, 246, 0.2);
}

html body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0.75rem;
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.5;
    color: var(--slate-grey);
    background: linear-gradient(180deg, var(--page-top), var(--page-bottom) 70%) no-repeat var(--page-bottom);
}

/* The wordmark, as in the landing page's header, and a way back to it. */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-alt);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.015em;
    color: var(--headings);
}
.auth-brand:hover,
.auth-brand:focus-visible { color: var(--headings); }
.auth-brand img { width: 32px; height: 32px; border-radius: 8px; }
.auth-brand-logo--dark { display: none; }
:root[data-theme="dark"] .auth-brand-logo--light { display: none; }
:root[data-theme="dark"] .auth-brand-logo--dark { display: block; }

.container {
    width: 100%;
    max-width: 430px;
    padding: 1.5rem 1.25rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border-mute);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.title {
    margin: 0 0 1.1rem;
    font-family: var(--font-alt);
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--headings);
}

.form { margin-bottom: 1rem; }
.form-group { margin-bottom: 0.875rem; }
.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--headings);
}
.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--muted);
}

html body .form-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    font-size: 1rem;                 /* 16px, or iOS zooms the page on focus */
    color: var(--headings);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
/* Signup: where-did-you-hear and the ad-consent choice. */
.signup-extras { margin-bottom: 1.1rem; }
.form-optional { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
html body select.form-input { appearance: auto; }
html body .heard-about-other { margin-top: 0.5rem; }
.ad-consent-choice {
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border-mute);
    border-radius: 10px;
    background: var(--ghost-white);
}
.ad-consent-label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--slate-grey);
    cursor: pointer;
}
.ad-consent-label input { margin-top: 0.2rem; flex: none; width: 1rem; height: 1rem; }
.ad-consent-label a { color: var(--headings); }

html body .form-input:focus {
    outline: none;
    border-color: var(--headings);
    box-shadow: 0 0 0 3px var(--focus);
    background: var(--surface);
}

/* Ink on paper, and paper on ink in the dark theme. No lift, no glow. */
html body .submit-btn,
html body .ps-button--primary {
    background: var(--btn-bg);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--btn-fg);
    box-shadow: none;
    transform: none;
    transition: background-color 0.18s ease;
}
html body .submit-btn {
    width: 100%;
    padding: 0.85rem;
    font-family: var(--font-alt);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
html body .submit-btn:hover,
html body .ps-button--primary:hover {
    background: var(--btn-bg-hover);
    box-shadow: none;
    transform: none;
}
html body .ps-button { border-radius: 10px; }
html body .ps-button--ghost:hover,
html body .ps-theme-toggle:hover {
    border-color: var(--headings);
    color: var(--headings);
    transform: none;
}

.oauth-section { margin-bottom: 1rem; }
html body .oauth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 0.625rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--headings);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: none;
    transform: none;
    transition: border-color 0.18s ease;
}
html body .oauth-button:hover {
    background: var(--surface);
    border-color: var(--headings);
    box-shadow: none;
    transform: none;
}
.oauth-button svg { width: 18px; height: 18px; flex-shrink: 0; }

.oauth-divider {
    position: relative;
    margin: 1rem 0;
    text-align: center;
}
.oauth-divider span {
    position: relative;
    z-index: 1;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--surface);
}
.oauth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-mute);
}

.error-message,
.success-message {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.links { margin-top: 0.875rem; text-align: center; }
.link {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--slate-grey);
}
/* A link in running text looks like one: ink, underlined. */
.link a {
    color: var(--headings);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}
.link a:hover { text-decoration-color: var(--headings); }

.footer {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* A line under the title, for pages that need to say what the form is for. */
.subtitle {
    margin: -0.6rem 0 1.1rem;
    font-size: 0.95rem;
    color: var(--slate-grey);
}

/* A link that does what the form button does, for the result pages. */
html body a.submit-btn {
    display: flex;
    text-decoration: none;
}
html body a.submit-btn:hover,
html body a.submit-btn:focus-visible { color: var(--btn-fg); }

/* Result pages: a status mark, a title, a sentence and one way forward. */
.container--result { text-align: center; }
.container--result .title { margin-bottom: 0.5rem; }
.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0.25rem auto 1rem;
    border-radius: 50%;
}
.status-icon svg { width: 24px; height: 24px; }
.status-icon.success { color: var(--success); background: var(--success-soft); }
.status-icon.error { color: var(--danger); background: var(--danger-soft); }
.message {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--slate-grey);
}
