/* auth.css: the sign-in pages (users/auth_base.html): a brand panel beside one card.
   Always dark, whatever the device: nobody is signed in yet, so there is no theme to follow. */

:root {
    --a-bg: #0e131b;
    --a-card: #161d29;
    --a-text: #e8edf6;
    --a-muted: #a3b0c6;
    --a-line: #313c50;
    --a-field: #0f1520;
    --a-accent: #3f72f0;
    --a-accent-dark: #2a5bd7;
    --a-side: #0a101a;
    --a-side-text: #e6ebf5;
    --a-side-muted: #9fb0cc;
    --a-error: #ffb0b8;
    --a-error-bg: #3a1a20;
    --a-ok: #9be0b8;
    --a-ok-bg: #143023;
    --a-info: #a9cbff;
    --a-info-bg: #15263f;
}

* { box-sizing: border-box; }

body.auth {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 40%) 1fr;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--a-text);
    background-color: var(--a-bg);
}

/* ---- the brand panel ---- */

.auth-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem;
    background-color: var(--a-side);
    color: var(--a-side-text);
}
.auth-side-logo { max-width: 190px; height: auto; }
.auth-side-title { margin: 0 0 0.75rem; font-size: 2.4rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.auth-side-text { margin: 0; max-width: 26rem; font-size: 1.05rem; color: var(--a-side-muted); }
.auth-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; color: var(--a-side-muted); font-size: 0.95rem; }
.auth-side-list li { display: flex; align-items: center; gap: 0.7rem; }
.auth-side-list i { font-size: 1.05rem; color: var(--a-side-text); }

/* ---- the card ---- */

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1.25rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 2rem;
    background-color: var(--a-card);
    border: 1px solid var(--a-line);
    border-radius: 16px;
}
.auth-logo { display: none; max-width: 160px; height: auto; margin-bottom: 1.25rem; }
.auth-title { margin: 0 0 0.35rem; font-size: 1.6rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.auth-lead { margin: 0 0 1.5rem; color: var(--a-muted); }
.auth-lead:empty { display: none; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.auth-field label { display: block; margin-bottom: 0.35rem; font-size: 0.86rem; font-weight: 600; }
.auth-input { position: relative; }
.auth-input input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background-color: var(--a-field);
    color: var(--a-text);
    font: inherit;
}
.auth-input.has-eye input { padding-right: 3rem; }
/* A saved email or password filled in by the browser keeps the dark field and
   the white text (browsers paint their own light colour otherwise). */
.auth-input input:-webkit-autofill,
.auth-input input:-webkit-autofill:hover,
.auth-input input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--a-text);
    caret-color: var(--a-text);
    -webkit-box-shadow: 0 0 0 1000px var(--a-field) inset;
    box-shadow: 0 0 0 1000px var(--a-field) inset;
    transition: background-color 9999s ease-out;
}
.auth-input input:autofill { -webkit-text-fill-color: var(--a-text); box-shadow: 0 0 0 1000px var(--a-field) inset; }
.auth-input input::placeholder { color: var(--a-muted); opacity: 0.75; }
.auth-input input:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 1px; border-color: var(--a-accent); }
.auth-field.bad .auth-input input { border-color: var(--a-error); }
.auth-eye {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 44px;
    border: 0;
    border-radius: 0 9px 9px 0;
    background: transparent;
    color: var(--a-muted);
    font-size: 1.05rem;
    cursor: pointer;
}
.auth-eye:hover { color: var(--a-text); }
.auth-eye:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; }
.auth-error { margin: 0.35rem 0 0; font-size: 0.84rem; color: var(--a-error); }
.auth-hint { margin: 0.35rem 0 0; font-size: 0.84rem; color: var(--a-muted); }

.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; font-size: 0.9rem; }
/* "Keep me signed in": a switch (the tick box itself is kept for the keyboard and the form). */
.auth-check { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
.auth-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.auth-check i { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background-color: #4a5468; transition: background-color 0.15s ease; }
.auth-check i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background-color: #ffffff; transition: transform 0.15s ease; }
.auth-check input:checked + i { background-color: var(--a-accent); }
.auth-check input:checked + i::after { transform: translateX(18px); }
.auth-check input:focus-visible + i { outline: 2px solid var(--a-text); outline-offset: 2px; }

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--a-accent);
    border-radius: 10px;
    background-color: var(--a-accent);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.auth-btn:hover { background-color: var(--a-accent-dark); border-color: var(--a-accent-dark); color: #ffffff; }
.auth-btn:focus-visible { outline: 2px solid var(--a-text); outline-offset: 2px; }
.auth-btn.ghost { background-color: transparent; color: var(--a-text); border-color: var(--a-line); }
.auth-btn.ghost:hover { background-color: var(--a-bg); color: var(--a-text); border-color: var(--a-muted); }

.auth a:not(.auth-btn) { color: #8fb1ff; font-weight: 600; text-decoration: none; }
.auth a:not(.auth-btn):hover { text-decoration: underline; }

.auth-notes { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.auth-note {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    background-color: var(--a-info-bg);
    color: var(--a-info);
}
.auth-note.error, .auth-note.danger { background-color: var(--a-error-bg); color: var(--a-error); }
.auth-note.success { background-color: var(--a-ok-bg); color: var(--a-ok); }

.auth-steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.auth-steps li { display: flex; align-items: flex-start; gap: 0.75rem; }
.auth-steps i { flex: none; font-size: 1.1rem; color: var(--a-accent); margin-top: 0.1rem; }
.auth-who { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1.25rem; font-weight: 600; overflow-wrap: anywhere; }

.auth-foot { margin: 0; font-size: 0.9rem; color: var(--a-muted); text-align: center; }
.auth-foot:empty { display: none; }
.auth-dot { margin: 0 0.35rem; }

/* ---- a phone, or a narrow window: the card alone ---- */

@media (max-width: 860px) {
    body.auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-logo { display: block; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .auth-two { grid-template-columns: 1fr; }
}
