/* Tokens: Campaign Design System (Dolist). Spacing is always a multiple of 5. */
:root {
    --color-primary: #4F6FFF;
    --color-primary-hover: #7C93FB;
    --color-primary-bg: #F6F8FF;
    --color-navy: #12183F;
    --color-white: #FFFFFF;
    --color-border: #D4D4D4;
    --color-field-border: #969696;
    --color-secondary: #707070;
    --color-text: #272727;
    --color-success: #36AB13;
    --color-success-bg: #E5F9F3;
    --color-error: #FC0315;
    --color-error-bg: #FBE9EA;

    --font-sans: Roboto, "Segoe UI", Arial, sans-serif;
    --font-condensed: "Roboto Condensed", Roboto, "Segoe UI", Arial, sans-serif;

    --radius-field: 5px;
    --radius-banner: 7px;
    --radius-button: 10px;
    --radius-card-large: 20px;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/roboto-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/roboto-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Roboto Condensed";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/roboto-condensed-latin-400-normal.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    font: 400 14px/19px var(--font-sans);
    color: var(--color-text);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul { margin: 0; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Page ─────────────────────────────────────────────────── */

.page {
    display: flex;
    min-height: 100vh;
}

.aside {
    flex: 0 1 40%;
    min-width: 360px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 50px;
    background: var(--color-navy);
    color: var(--color-white);
}

.aside__logo {
    display: block;
    width: 150px;
    height: auto;
    color: var(--color-white);
}

.aside__content { max-width: 460px; }

.aside__title {
    font: 400 34px/40px var(--font-condensed);
    color: var(--color-white);
    text-wrap: balance;
}

.aside__intro {
    margin-top: 15px;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-border);
}

.aside__points {
    margin-top: 40px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.aside__point {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.aside__point-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aside__point-title {
    font-size: 15px;
    line-height: 20px;
    font-weight: 500;
}

.aside__point-detail { color: var(--color-border); }

.aside__icon {
    flex: none;
    width: 20px;
    height: 20px;
}

.aside__legal {
    font-size: 12px;
    line-height: 16px;
    color: var(--color-border);
}

.main {
    flex: 1 1 0;
    min-width: 0;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.main__logo {
    display: none;
    width: 130px;
    height: auto;
    color: var(--color-navy);
}

.footer {
    font-size: 12px;
    line-height: 16px;
    color: var(--color-secondary);
    text-align: center;
}

@media (max-width: 900px) {
    .aside { display: none; }
    .main__logo { display: block; }
}

/* ── Card ─────────────────────────────────────────────────── */

.card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card-large);
}

.card__title {
    font: 400 22px/26px var(--font-condensed);
    color: var(--color-text);
    text-wrap: balance;
}

.card__subtitle {
    margin-top: 20px;
    color: var(--color-secondary);
}

.card__subtitle b {
    font-weight: 500;
    color: var(--color-text);
}

.card__form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card__fields {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card__links {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.card__inline {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    color: var(--color-secondary);
}

.card__meta {
    margin-top: 10px;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-secondary);
}

.card__actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card__details {
    margin-top: 20px;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-secondary);
}

.card__details summary { cursor: pointer; }

.card__details dl {
    margin: 10px 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 15px;
}

.card__details dd { margin: 0; overflow-wrap: anywhere; }

.card__status {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--color-secondary);
}

/* ── Field (DS Input: H40, r5, 1px #969696; the label floats above once the field is filled) ── */

.field__box { position: relative; }

.field__input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font: 400 14px var(--font-sans);
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-field-border);
    border-radius: var(--radius-field);
    outline: none;
}

.field__input::placeholder {
    color: var(--color-field-border);
    opacity: 1;
}

.field__input[readonly] {
    color: var(--color-secondary);
    text-overflow: ellipsis;
    border-color: var(--color-border);
    cursor: default;
}

.field__input:focus { border-color: var(--color-primary); }

/* Room for the trailing control (.field__action) drawn over the input. */
.field__input--icon { padding-right: 45px; }

/* Edge adds its own reveal button to password fields, next to ours. */
.field__input::-ms-reveal { display: none; }

/* Chrome paints autofilled fields light blue; keep the DS white surface. */
.field__input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--color-white) inset;
    -webkit-text-fill-color: var(--color-text);
}

/* Transparent rather than display:none so the label keeps naming the field for screen readers. */
.field__label {
    position: absolute;
    top: -7px;
    left: 10px;
    padding: 0 4px;
    font: 400 12px/14px var(--font-sans);
    color: var(--color-field-border);
    background: var(--color-white);
    pointer-events: none;
    opacity: 0;
}

.field__input:not(:placeholder-shown) + .field__label { opacity: 1; }
.field__input:-webkit-autofill + .field__label { opacity: 1; }

.field__action {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.field__toggle {
    right: 5px;
    display: flex;
    padding: 5px;
    color: var(--color-secondary);
    background: none;
    border: none;
    cursor: pointer;
}

.field__toggle:hover { color: var(--color-primary); }

.field__toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field__toggle[aria-pressed="false"] .field__toggle-shown,
.field__toggle[aria-pressed="true"] .field__toggle-hidden { display: none; }

.field--error .field__input,
.field--error .field__input:focus { border-color: var(--color-error); }

.field--error .field__label { color: var(--color-error); }

.field__error {
    margin-top: 5px;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-error);
}

/* ── Button (DS primary large: H40, r10, 16px/500) ───────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    padding: 0 20px;
    font: 500 16px/1 var(--font-sans);
    color: var(--color-white);
    white-space: nowrap;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.button:hover, .button:focus-visible {
    color: var(--color-white);
    background: var(--color-primary-hover);
}

.button:disabled {
    background: var(--color-border);
    cursor: default;
}

.button--ghost {
    color: var(--color-primary);
    background: var(--color-white);
    border: 1px solid var(--color-primary);
}

.button--ghost:hover, .button--ghost:focus-visible {
    color: var(--color-primary);
    background: var(--color-primary-bg);
}

/* A POST action (e.g. resend the code) that reads as a text link. */
.text-button {
    padding: 0;
    font: inherit;
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
}

.text-button:hover { color: var(--color-primary-hover); }

/* The label stays in place (width, screen readers) but is painted over by the spinner. */
.button.button--loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.button--loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.text-button[aria-disabled="true"] {
    color: var(--color-secondary);
    pointer-events: none;
}

/* ── Notice (DS Banner: 1px accent border, r7, 18px round icon, gap 10).
      Not named .banner: CAS default views put that class on their own cards. ── */

.notice {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: var(--color-text);
    border: 1px solid;
    border-radius: var(--radius-banner);
}

.notice__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font: 400 12px/18px var(--font-sans);
    color: var(--color-white);
    border-radius: 50%;
}

.notice__icon svg { width: 18px; height: 18px; }

.notice--info { background: var(--color-primary-bg); border-color: var(--color-primary); }
.notice--info .notice__icon { background: var(--color-primary); }
.notice--success { background: var(--color-success-bg); border-color: var(--color-success); }
.notice--success .notice__icon { background: var(--color-success); }
.notice--error { background: var(--color-error-bg); border-color: var(--color-error); }
.notice--error .notice__icon { background: var(--color-error); }

/* ── Spinner ──────────────────────────────────────────────── */

.spinner {
    flex: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner, .button--loading::after { animation-duration: 2.4s; }
}

/* ── CAS default views not overridden in this theme still render inside this layout:
      their content root carries .card, a h2 title, plain paragraphs and .mdc-button links. ── */

.card > h2 {
    font: 400 22px/26px var(--font-condensed);
    color: var(--color-text);
}

.card > h2 ~ p:not([class]) {
    margin-top: 20px;
    color: var(--color-secondary);
}

.card a.mdc-button,
.card button.mdc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    margin-top: 30px;
    padding: 0 20px;
    font: 500 16px/1 var(--font-sans);
    color: var(--color-white);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
}

.card a.mdc-button:hover,
.card button.mdc-button:hover { color: var(--color-white); background: var(--color-primary-hover); }
