/* The entry pages: guest details (info.php), sign-in (login.php), sign-up,
   the code page (verify.php) and password reset. Day and night like the
   homepage (body.s-themed; the colours are the --s- tokens). */

body {
    font-family: var(--font-ui);
    background: var(--s-page);
    color: var(--s-ink);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; min-height: 100dvh;
}

/* -- the frame: top bar back to the site, footer (includes/entry_shell.php) -- */

/* The homepage's top bar: sticky, a little see-through, 64px. */
.entry-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--s-card) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--s-line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .entry-top { background: var(--s-card); } }
.entry-top-in {
    max-width: 1160px;
    margin: 0 auto;
    min-height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
@media (min-width: 768px) { .entry-top-in { padding: 0 24px; } }
.entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}
.entry-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--s-tap-min);
    text-decoration: none;
    color: var(--s-ink);
    min-width: 0;
}
.entry-logo {
    max-height: 34px;
    max-width: 130px;
}
.entry-badge {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--s-primary);
    color: var(--s-on-primary);
    font-weight: 800;
    font-size: 14px;
}
.entry-name {
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.entry-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--s-line);
    border-radius: 10px;
    color: var(--s-ink);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    flex: none;
}
.entry-home:hover {
    background: var(--s-primary-soft);
}
.entry-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}
.entry-main + .site-foot { margin-top: 0; }
.entry-flash { max-width: 420px; margin: 20px auto 0; width: calc(100% - 32px); box-sizing: border-box; }

/* The Privacy Policy and Terms (includes/legal_page.php): one long card. */
.card.legal {
    max-width: 820px;
    line-height: 1.65;
    font-size: 15px;
}
.legal h1 { margin: 0 0 6px; font-size: 26px; }
.legal h2 { margin: 26px 0 8px; font-size: 18px; }
.legal p, .legal li { color: var(--s-ink); }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal-meta { color: var(--s-ink-dim) !important; font-size: 14px; margin: 0 0 8px; }
.legal a { color: var(--s-primary); }
.card {
    background: var(--s-card);
    padding: 36px;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-md);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    border: 1px solid var(--s-line);
}
.header-logo {
    text-align: center;
    margin-bottom: 28px;
}
/* The page's title; the institute's name is in the top bar above. */
.header-logo h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--s-ink);
}
@media (max-width: 520px) {
    .entry-name { font-size: 15px; }
    .entry-main { align-items: flex-start; padding: 16px; }
    .card { padding: 24px 20px; box-shadow: none; }
}
.header-logo p {
    margin: 8px 0 0 0;
    color: var(--s-ink-dim);
    font-size: 15px;
}
.form-group {
    position: relative;
    margin-bottom: 24px;
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--s-line-soft);
    border-radius: var(--s-radius);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    color: var(--s-ink);
    background: transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--s-primary);
    box-shadow: 0 0 0 4px var(--s-primary-soft);
}
.form-label {
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--s-card);
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--s-ink-dim);
    transition: color 0.2s ease;
}
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    color: var(--s-primary);
}
.btn {
    background: var(--s-primary);
    color: var(--s-on-primary);
    border: none;
    padding: 16px;
    border-radius: var(--s-radius);
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 16px;
    font-family: inherit;
    min-height: var(--s-tap-min);
}
.btn:hover {
    background: var(--s-primary-hover);
}
.error {
    color: var(--s-danger);
    font-size: 13px;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
}
.error[hidden] {
    display: none;
}
.field-hint {
    margin: 6px 4px 0;
    font-size: 12px;
    color: var(--s-ink-dim);
}
.form-label .opt {
    font-weight: 400;
}

/* -- added for sign-in ------------------------------------------- */

.notice {
    padding: 12px 14px;
    border-radius: var(--s-radius);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.45;
}
.notice-error {
    background: var(--s-warn-soft);
    border-left: 4px solid var(--s-danger);
    color: var(--s-ink);
}
.alt-link {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--s-ink-dim);
}
.alt-link a {
    color: var(--s-primary);
    font-weight: 600;
}

/* -- sign-in codes, sign-up, Google --------------------------------- */

.notice-success {
    background: var(--s-ok-soft);
    border-left: 4px solid var(--s-ok);
    color: var(--s-ink);
}
/* A button that reads as a link: "Send a new code". */
.link-btn {
    background: none;
    border: 0;
    padding: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--s-primary);
    cursor: pointer;
    min-height: var(--s-tap-min);
}
.link-btn:disabled {
    color: var(--s-ink-dim);
    cursor: default;
}
.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    text-decoration: none;
    background: var(--s-card);
    color: var(--s-ink);
    border: 2px solid var(--s-line);
}
.btn-outline:hover {
    background: var(--s-primary-soft);
}
/* "or" between two ways in. */
.or-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 13px;
    color: var(--s-ink-dim);
}
.or-line::before,
.or-line::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--s-line-soft);
}

/* -- the two-part layout: a panel beside the card (entry_open()) ------ */

.entry-split {
    display: flex;
    width: 100%;
    max-width: 440px;
}
.entry-split > .card {
    max-width: none;
    flex: 1;
    min-width: 0;
}
/* On a phone the form alone: the panel would push it below the fold. */
.entry-aside { display: none; }

@media (min-width: 900px) {
    .entry-main { padding: 40px 24px; }
    .entry-split {
        max-width: 980px;
        border-radius: 18px;
        box-shadow: var(--s-shadow-md);
    }
    .entry-split > .card {
        border-radius: 0 18px 18px 0;
        border-left: 0;
        box-shadow: none;
        padding: 44px 52px;
    }
    .entry-split .header-logo { text-align: left; }
    .entry-aside {
        display: flex;
        flex-direction: column;
        flex: 0 0 40%;
        box-sizing: border-box;
        padding: 48px 40px;
        border-radius: 18px 0 0 18px;
        color: var(--s-aside-ink);
        background:
            radial-gradient(circle at 100% 0, var(--s-aside-chip) 0 140px, transparent 141px),
            radial-gradient(circle at 0 100%, var(--s-aside-chip) 0 110px, transparent 111px),
            linear-gradient(160deg, var(--s-aside-from), var(--s-aside-to));
    }
}
.ea-eyebrow {
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--s-aside-dim);
}
.ea-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
}
.ea-sub {
    margin: 12px 0 28px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--s-aside-dim);
}
.ea-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.ea-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 15px;
    line-height: 1.45;
}
.ea-tick {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--s-aside-chip);
    border: 1px solid var(--s-aside-line);
}
.ea-stats {
    margin-top: auto;
    padding-top: 32px;
}
.ea-stat {
    margin: 0;
    font-size: 18px;
    color: var(--s-aside-dim);
}
.ea-stat b {
    font-size: 28px;
    font-weight: 800;
    color: var(--s-aside-ink);
    margin-right: 4px;
}

/* -- fields with an icon and a show-password button (form_fields.php) -- */

.form-group { margin-bottom: 22px; }
.form-control { min-height: 52px; }
.form-control:hover { border-color: var(--s-line); }
.form-control:focus { border-color: var(--s-primary); }
.fc-icon {
    position: absolute;
    top: 0;
    left: 14px;
    height: 52px;
    display: flex;
    align-items: center;
    color: var(--s-ink-faint);
    pointer-events: none;
    transition: color 0.2s ease;
}
.has-icon .form-control { padding-left: 46px; }
.has-icon .form-control:focus ~ .fc-icon { color: var(--s-primary); }
.has-after .form-control { padding-right: 52px; }
.fc-eye {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    display: none;
    place-items: center;
    border: 0;
    border-radius: var(--s-radius);
    background: transparent;
    color: var(--s-ink-faint);
    cursor: pointer;
}
html.js .fc-eye { display: grid; }
.fc-eye:hover { color: var(--s-ink); background: var(--s-sunken); }
.fc-eye .eye-slash { display: none; }
.fc-eye[aria-pressed="true"] .eye-slash { display: inline; }
.fc-eye[aria-pressed="true"] { color: var(--s-primary); }

/* The password strength bar: a guide while typing, never a rule. */
.pw-meter {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 8px 4px 0;
}
html.js .pw-meter.is-on { display: flex; }
.pw-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    flex: 1;
}
.pw-bars i {
    height: 5px;
    border-radius: 3px;
    background: var(--s-line-soft);
}
.pw-text {
    font-size: 12px;
    font-weight: 600;
    min-width: 64px;
    text-align: right;
    color: var(--s-ink-dim);
}
.pw-meter[data-score="1"] .pw-bars i:nth-child(-n+1),
.pw-meter[data-score="2"] .pw-bars i:nth-child(-n+2) { background: var(--s-danger); }
.pw-meter[data-score="1"] .pw-text,
.pw-meter[data-score="2"] .pw-text { color: var(--s-danger); }
.pw-meter[data-score="3"] .pw-bars i:nth-child(-n+3) { background: var(--s-warn); }
.pw-meter[data-score="3"] .pw-text { color: var(--s-warn); }
.pw-meter[data-score="4"] .pw-bars i { background: var(--s-ok); }
.pw-meter[data-score="4"] .pw-text { color: var(--s-ok); }

/* -- the agreement and the CAPTCHA, tightened for the form ------------ */

.consent {
    background: var(--s-sunken);
    border-color: var(--s-line-soft);
    border-radius: var(--s-radius-lg);
    padding: 14px 16px 10px;
}
.consent legend {
    background: var(--s-card);
    border-radius: 6px;
}
.consent-ages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 4px 0;
}
.consent-ages .consent-opt {
    margin: 0;
    padding: 10px 12px;
    border: 2px solid var(--s-line-soft);
    border-radius: var(--s-radius);
    background: var(--s-card);
    font-size: 13px;
}
.consent-ages .consent-opt:hover { border-color: var(--s-line); }
.consent-ages .consent-opt:has(input:checked) {
    border-color: var(--s-primary);
    background: var(--s-primary-soft);
}
.consent-ages .consent-opt input { accent-color: var(--s-primary); }
.consent-agree input { accent-color: var(--s-primary); }
.consent-guardian { margin: 10px 0 4px; }
@media (max-width: 420px) {
    .consent-ages { grid-template-columns: 1fr; }
}

.captcha-box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
}
.captcha-box .captcha-pic { margin: 0; flex: none; }
.captcha-box .captcha-svg { width: 168px; }
.captcha-box .captcha-img { min-height: 44px; align-items: center; }
.captcha-answer {
    flex: 1;
    min-width: 150px;
    margin: 0;
}
.captcha-error { margin: -14px 4px 18px; }
