/* ===== LOGIN PAGE ===== */

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-8);
    background: var(--color-midnight-800);
    border: 1px solid rgba(68, 120, 204, 0.25);
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 40px rgba(68, 120, 204, 0.1),
        0 0 80px rgba(68, 120, 204, 0.05);
}

/* ── Logo ── */

.login-card__logo {
    display: flex;
    justify-content: center;
    margin-block-end: var(--space-6);
}

.login-card__logo img {
    height: 44px;
    width: auto;
}

/* ── Heading ── */

.login-card__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    text-align: center;
    margin: 0 0 var(--space-1) 0;
}

.login-card__subtitle {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    text-align: center;
    margin: 0 0 var(--space-6) 0;
}

/* An email address named in the subtitle breaks inside the card, however
   long it is. */
.login-card__subtitle strong {
    overflow-wrap: anywhere;
}

/* ── Notices ── */

/* The shared alert has no margin of its own: on the card it keeps 20 px
   from the form, button or link under it. */
.login-card .alert {
    margin-block-end: var(--space-5);
}

/* A notice straight under the title (Account Locked has no subtitle). */
.login-card__title + .alert {
    margin-block-start: var(--space-5);
}

/* A success notice leads with an icon (Password Updated, You're Logged
   Out): it keeps its size beside a sentence that wraps. */
.login-card .alert svg {
    flex-shrink: 0;
}

/* A notice that names an email address breaks it inside the card. */
.login-card .alert span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ── Form ── */

.login-card__form {
    display: flex;
    flex-direction: column;
}

/* A second form under the first (Confirm Your Email's Email Me a New Code):
   12 px between the two buttons, so a slip does not press the other. */
.login-card__form + .login-card__form {
    margin-block-start: var(--space-3);
}

/* Dark-themed labels */
.login-card__label {
    color: var(--color-slate-300);
}

/* ── Password toggle ── */

.login-card__password-wrap {
    position: relative;
}

.login-card__password-wrap .input {
    padding-inline-end: var(--space-12);
}

/* A 44 px target (--tap-min) inside the 52 px field; the 18 px icon stays
   where it was, 26 px from the field's edge. */
.login-card__eye {
    position: absolute;
    right: var(--space-1);
    top: 50%;
    transform: translateY(-50%);
    width: var(--tap-min);
    height: var(--tap-min);
    background: none;
    border: none;
    padding: 0;
    color: var(--color-slate-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-fast) var(--ease-default);
}

.login-card__eye:hover {
    color: var(--color-slate-200);
}

/* ── Options row ── */

/* The label and the link are 44 px targets (--tap-min); the row's margins
   take the extra height back, so the text sits where it did. */
.login-card__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block: calc(-1 * var(--space-3)) var(--space-2);
}

.login-card__remember {
    display: flex;
    align-items: center;
    min-height: var(--tap-min);
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    cursor: pointer;
}

.login-card__checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--control-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    margin: 0;
}

.login-card__checkbox:hover {
    border-color: var(--neon-blue);
    background: rgba(68,136,255,0.08);
}

.login-card__checkbox:checked {
    background: var(--color-cb-blue, #4478cc);
    border-color: var(--color-cb-blue, #4478cc);
    box-shadow: 0 0 8px rgba(68,136,255,0.3);
}

.login-card__checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-card__checkbox:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.login-card__forgot {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    font-size: var(--text-sm);
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
}

.login-card__forgot:hover {
    color: var(--link-hover);
}

/* ── Submit button ── */

.login-card__submit {
    width: 100%;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
}

/* ── Footer ── */

.login-card__footer {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-block-start: var(--space-5);
}

/* The link sits in a muted sentence a shade away from it (1.17:1), so the
   underline, not the colour, says it is a link. */
.login-card__link {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: var(--weight-medium);
    transition: color var(--duration-fast) var(--ease-default);
}

.login-card__link:hover {
    color: var(--link-hover);
}

/* A link that stands alone as a page's way on (Account Locked): a 44 px
   target (--tap-min). */
.login-card__link--tap {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
}

/* ── Loading spinner ── */

.login-card__spinner-wrap {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.login-card__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Entrance animation ── */

.login-card--animate {
    animation: fadeUp 0.4s ease-out both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Name row (registration) ── */

.login-card__name-row {
    display: flex;
    gap: var(--space-4);
}

.login-card__name-row .form-group {
    flex: 1;
}

/* ── Password requirements hint ── */

.login-card__requirements {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-5) 0;
}

.login-card__requirements li {
    font-size: var(--text-sm);
    color: var(--text-muted);
    padding-inline-start: var(--space-4);
    position: relative;
    line-height: var(--leading-relaxed);
}

.login-card__requirements li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-midnight-600);
}

/* ── Sign-up captcha (accounts/partials/_captcha.html) ── */

.captcha-box {
    margin-block-end: var(--space-5);
}

/* "Tick the box..." sits 8 px under the box (inside the box's 20 px
   margin) and keeps 20 px above Create Account. */
.login-card__captcha-error {
    margin-block: calc(-1 * var(--space-3)) var(--space-5);
}

/* ── Responsive ── */

@media (max-width: 35.99em) {
    .login-card {
        padding: var(--space-6);
    }

    .login-card__name-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Google's box is a fixed 304 by 78 px frame. Under 402 px the card's
   column is narrower than that (the screen less 98 px of gutters, padding
   and edge), so the frame is scaled to fit it: 277 px at 375, 262 px at
   360, 222 px at 320. */
@media (max-width: 25.1em) {
    .captcha-box { height: calc(78px * 0.91); }
    .captcha-box > div { transform: scale(0.91); transform-origin: 0 0; }
}

@media (max-width: 23.4em) {
    .captcha-box { height: calc(78px * 0.86); }
    .captcha-box > div { transform: scale(0.86); }
}

@media (max-width: 22.45em) {
    .captcha-box { height: calc(78px * 0.73); }
    .captcha-box > div { transform: scale(0.73); }
}
