/* ============================================================================
   auth.css — the sign-in pages (pages/auth/): one centred Ant card, as a
   login form is in Ant Design Pro. Public, like the rest of /static/css/.

   The page is the layout grey under the website's dot wave
   (js/auth/dot-wave.js); the card is the theme's container, with large (40px)
   fields and actions, and the Aventurine mark faint in its lower right corner.
   ============================================================================ */

/* The page isolates, so the canvas at z-index -1 sits over the page's grey
   and under the card. It scrolls by itself, because the app's body does not
   (style.css), and a card can be taller than a phone. */
.auth-page {
    position: relative;
    isolation: isolate;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    display: flex;
    padding: var(--space-16);
    background: var(--color-bg-layout);
}
/* The accent here is the website's charcoal (the aventurine neutral ramp in
   the site's base.css), not the app's blue. The tokens are re-pointed on the
   page, so the buttons, field focus ring and links below follow without
   changes; the app's own pages keep the blue. */
.auth-page {
    --color-primary:              #3a3630;
    --color-primary-hover:        #544f47;
    --color-primary-active:       #1c1a16;
    --color-primary-bg:           #f5f2ea;
    --color-primary-bg-hover:     #eae6da;
    --color-primary-border:       #d4cec1;
    --color-primary-border-hover: #bcb6a8;
    --color-primary-text:         #3a3630;
    --color-link:                 #3a3630;
    --color-link-hover:           #544f47;
    --color-link-active:          #1c1a16;
    --control-outline:            rgba(58, 54, 48, 0.1);
    --button-primary-shadow:      0 2px 0 rgba(58, 54, 48, 0.1);
}
/* On the dark card charcoal would vanish, so the accent takes the ramp's light
   end and the primary button's label turns to ink. */
html[data-theme="dark"] .auth-page {
    --color-primary:              #d4cec1;
    --color-primary-hover:        #eae6da;
    --color-primary-active:       #bcb6a8;
    --color-primary-bg:           #3a3630;
    --color-primary-bg-hover:     #544f47;
    --color-primary-border:       #544f47;
    --color-primary-border-hover: #6f695f;
    --color-primary-text:         #d4cec1;
    --color-link:                 #d4cec1;
    --color-link-hover:           #eae6da;
    --color-link-active:          #bcb6a8;
    --color-text-light-solid:     #1c1a16;
    --control-outline:            rgba(212, 206, 193, 0.15);
    --button-primary-shadow:      0 2px 0 rgba(212, 206, 193, 0.15);
}
.auth-page .dot-wave {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    color: var(--color-border);
    pointer-events: none;
}

/* Centred by its margins, not the flex box's alignment, which would push the
   top of a card taller than the screen out of reach. */
.auth-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: none;
    margin: auto;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    padding: var(--space-32);
    background: var(--color-bg-container);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    color: var(--color-text);
}
/* The watermark: the mark's rounded triangle (icons/logo/mark.svg) a shade
   off the card, run off the corner, under the card's content. */
.auth-card::after {
    content: '';
    position: absolute;
    right: calc(-1 * var(--space-24));
    bottom: calc(-1 * var(--space-24));
    z-index: -1;
    width: 160px;
    aspect-ratio: 2.8173 / 2.7004;
    background: var(--color-fill-tertiary);
    -webkit-mask: url('/static/icons/logo/mark.svg') center / contain no-repeat;
            mask: url('/static/icons/logo/mark.svg') center / contain no-repeat;
    pointer-events: none;
}

.auth-title {
    margin: 0;
    font-size: var(--font-size-heading-3);
    font-weight: var(--font-weight-strong);
    line-height: 1.3333;
}

.auth-note {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size);
    line-height: var(--line-height);
}
.auth-note:focus { outline: none; }

.auth-form { display: flex; flex-direction: column; gap: var(--space-8); }
/* Ant's large input. */
.auth-form .field-input { height: var(--control-height-lg); padding: 7px 11px; font-size: var(--font-size-lg); border-radius: var(--border-radius-lg); }
/* An autofilled field keeps the card's fill and ink, not the browser's blue
   tint. The tint is the browser's own background and cannot be unset, so an
   inset shadow as large as the field paints the fill back over it. :is() is
   forgiving, so a browser that knows only one of the two names still
   matches. */
.auth-form .field-input:is(:-webkit-autofill, :autofill) {
    -webkit-box-shadow: inset 0 0 0 1000px var(--color-bg-container);
            box-shadow: inset 0 0 0 1000px var(--color-bg-container);
    -webkit-text-fill-color: var(--color-text);
    filter: none;
}
/* Ant's large, full-width primary action. */
.auth-form .button-primary,
.auth-card > .button-primary {
    height: var(--control-height-lg);
    margin-top: var(--space-8);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-lg);
}

.auth-label {
    color: var(--color-text);
    font-size: var(--font-size);
}

.auth-error {
    margin: 0;
    color: var(--color-error-text);
    font-size: var(--font-size);
    line-height: var(--line-height);
}

.auth-actions { display: flex; flex-direction: column; gap: var(--space-8); }
.auth-actions .button-primary,
.auth-actions .button-secondary { height: var(--control-height-lg); border-radius: var(--border-radius-lg); font-size: var(--font-size-lg); }

.auth-foot {
    margin: 0;
    color: var(--color-text-tertiary);
    font-size: var(--font-size);
}
.auth-foot a { color: var(--color-link); text-decoration: none; }
.auth-foot a.auth-link-underline { text-decoration: underline; }
.auth-sent-title {
    display: block;
    margin-bottom: var(--space-16);
    padding: var(--space-8) var(--space-16);
    background: #e6f4ff;
    border: 1px solid #91caff;
    border-radius: var(--border-radius-lg);
    color: #0958d9;
    font-weight: 600;
    text-align: center;
}
html[data-theme="dark"] .auth-sent-title { background: #111a2c; border-color: #15395b; color: #69b1ff; }
.auth-foot a:hover { color: var(--color-link-hover); }
.auth-foot a:focus-visible { outline: 4px solid var(--color-primary-border); outline-offset: 1px; border-radius: var(--border-radius-sm); }

/* The privacy page (pages/auth/privacy.html). Its card holds more than a
   sign-in form, so its steps stack with the card's own gap. */
.auth-title:focus { outline: none; }
.auth-step { display: flex; flex-direction: column; gap: var(--space-16); }
.auth-step[hidden] { display: none; }
.auth-wide { width: 100%; height: var(--control-height-lg); border-radius: var(--border-radius-lg); font-size: var(--font-size-lg); }
.auth-inline-link { color: var(--color-link); text-decoration: underline; }
.auth-inline-link:hover { color: var(--color-link-hover); }
.auth-inline-link:focus-visible { outline: 4px solid var(--color-primary-border); outline-offset: 1px; border-radius: var(--border-radius-sm); }

.privacy-list {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-8) var(--space-16);
    margin: 0;
    font-size: var(--font-size);
    line-height: var(--line-height);
}
.privacy-list dt { color: var(--color-text-secondary); }
.privacy-list dd { margin: 0; color: var(--color-text); overflow-wrap: anywhere; }

.privacy-danger {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    padding-top: var(--space-16);
    border-top: var(--line-width) solid var(--color-border-secondary);
}
.privacy-danger-title { margin: 0; font-size: var(--font-size-lg); font-weight: var(--font-weight-strong); }
.privacy-effects {
    margin: 0;
    padding-left: var(--space-16);
    color: var(--color-text-secondary);
    font-size: var(--font-size);
    line-height: var(--line-height);
}
.privacy-effects li + li { margin-top: var(--space-8); }
.auth-form .button-danger {
    height: var(--control-height-lg);
    margin-top: var(--space-8);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-lg);
}
