/* ==========================================================================
   Santander (san-base) brand override layer.
   Loaded AFTER the inherited nbs-base ice-base.css / ice-digital.css, so these
   rules win the cascade. Only brand-specific overrides live here — layout and
   structure come from the parent theme.
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------- */
@font-face {
    font-family: "Santander Headline";
    font-weight: 400;
    src: local("Santander Headline"), url("../font/santander/SantanderHeadline-Regular.otf");
    font-display: swap;
}

@font-face {
    font-family: "Santander Headline";
    font-weight: 700;
    src: local("Santander Headline Bold"), url("../font/santander/SantanderHeadline-Bold.otf");
    font-display: swap;
}

@font-face {
    font-family: "Santander Micro Text";
    font-weight: 400;
    src: local("Santander Micro Text"), url("../font/santander/SantanderMicroText.otf");
    font-display: swap;
}

@font-face {
    font-family: "Santander Micro Text";
    font-weight: 600;
    src: local("Santander Micro Text SemiBold"), url("../font/santander/SantanderMicroTextSmBd.otf");
    font-display: swap;
}

@font-face {
    font-family: "Santander Micro Text";
    font-weight: 700;
    src: local("Santander Micro Text Bold"), url("../font/santander/SantanderMicroTextBd.otf");
    font-display: swap;
}

/* ---- Palette / token remap -------------------------------------------- */
:root {
    /* Santander brand tokens */
    --san-action-red: #EC0000;
    --san-action-red-hover: #CC0000;
    --san-action-teal: #127277;
    --san-action-teal-hover: #0D5155;
    --san-text-default: #222222;
    --san-text-soft: #727272;
    --san-border-default: #8F8F8F;
    --san-border-hover: #222222;
    --san-header-border: #CEDEE7;
    --san-focus-blue: #3366FF;
    --san-error: #990000;
    --san-background-error: #FEE5E5;
    --san-shadow: #A3A3A366;
    --san-surface-flat: #FFFFFF;
    --san-surface-disabled: rgba(34, 34, 34, 0.06);
    --san-text-disabled: rgba(34, 34, 34, 0.23);

    /* Remap the nbs-base variables that drive shared components.
       NOTE: --Primary-Blue is reused by nbs for the header bar, headings AND the
       footer, so it is NOT globally remapped to red — see targeted rules below. */
    --Text-Body: var(--san-text-default);
    --Text-Headline: var(--san-text-default);
    --Body-Colour-Label: var(--san-text-default);
    --ice-hyperlink: var(--san-action-teal);
    --Interaction-LinkHover: var(--san-action-teal-hover);
    --Field-Hover: var(--san-focus-blue);
    --Feedback-Error: var(--san-error);
    --Background-Error: var(--san-background-error);

    --ice-paragraph-font-size: 16px;

    --pf-global--FontFamily--sans-serif: "Santander Micro Text", "Arial", "Helvetica", sans-serif;
    --title-font-family: "Santander Headline", "Arial", "Helvetica", serif;

    /* Content container width. Figma insets content 142px on a 1440 artboard =
       (1440-1156)/2, i.e. a 1156px centred column (Santander's max content width),
       not nbs's 1230px. Drives header wrapper, main and footer widths. */
    --max-width-desktop: 1156px;
}

/* ---- Base typography --------------------------------------------------- */
.login-pf body {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    color: var(--san-text-default);
}

h1#kc-page-title {
    margin: 0;
    padding: 0;
}

#kc-content-wrapper {
    margin-top: 40px;
}

h1,
h2,
h3,
h4,
h5,
#kc-page-title {
    font-family: var(--title-font-family);
    font-weight: 400;
    color: var(--san-text-default);
}

h1,
#kc-page-title {
    font-size: 48px;
    line-height: 60px;
}

h2 {
    font-size: 42px;
    line-height: 52px;
}

h3 {
    font-size: 36px;
    line-height: 44px;
}

h4 {
    font-size: 28px;
    line-height: 36px;
}

h5 {
    font-size: 24px;
    line-height: 32px;
}

.pf-c-button {
    font-size: 16px;
    line-height: 24px;
}

/* ---- Skip link --------------------------------------------------------- */
/* Figma node 135:351 "Skip to content alert" — full-bleed focus-blue bar with a
   white underlined label and right arrow. Overrides nbs's navy-on-PlaqueBlue
   bordered box in ice-digital.css. The positioning (absolute, left 0,
   top -100px, z-index, width 100%) is inherited from there unchanged. */
#kc-skip-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    box-sizing: border-box;
    /* nbs draws a 4px --Interaction-LinkHover border around the bar. */
    border: none;
    background: var(--san-focus-blue);
    color: var(--san-surface-flat);
    /* nbs centres the label; Santander sits it behind the 24px side padding. */
    text-align: left;
    padding: 16px 24px;
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    text-decoration: none;
}

/* Only the label is underlined — the arrow is not. */
#kc-skip-link > span {
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}

#kc-skip-link > svg {
    width: 20px;
    height: 16px;
    flex-shrink: 0;
}

/* Stay white through every link state — the generic `a:hover` / `a:focus` teal
   below would otherwise win, since the id rule above has no pseudo-class. */
#kc-skip-link:hover,
#kc-skip-link:visited,
#kc-skip-link:focus,
#kc-skip-link:active {
    color: var(--san-surface-flat);
}

#kc-skip-link:focus {
    top: 0;
    /* The bar sliding into view is the focus indicator; drop the inherited
       link / .link-styling blue double ring and its 4px radius. */
    box-shadow: none;
    border-radius: 0;
}

/* ---- Header: white bar, red top strip, red logo ----------------------- */
#kc-header,
.ice-backup-header {
    background: var(--san-surface-flat);
    border-top: 8px solid var(--san-action-red);
    border-bottom: 1px solid var(--san-header-border);
    height: unset;
    padding: 12px 16px;
}

#kc-header-wrapper,
.ice-backup-header-wrapper {
    color: var(--san-text-default);
    padding: 9px 0;
}

/* Desktop logo intrinsic aspect ratio (137x24). */
#kc-header-img {
    height: 24px;
    padding-bottom: 6px;
    box-sizing: content-box;
}

/* Mobile uses the same red wordmark — override the square sizing from nbs. */
#kc-header-img-mobile {
    height: 24px;
}

#kc-content {
    padding-bottom: 40px;
}

.login-pf-page .login-pf-header {
    margin-bottom: 0;
}

.login-pf-page > main,
.san-footer,
.san-footer-brand-inner {
    width: 100%;
    max-width: calc(var(--max-width-desktop) + 32px);
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* Header wrapper centres within #kc-header (which supplies the 16px side padding),
   so it only needs the 1156px cap — no extra gutter. */
#kc-header-wrapper,
.ice-backup-header-wrapper {
    width: 100%;
    max-width: var(--max-width-desktop);
    box-sizing: border-box;
}

/* ---- Links: teal, bold, underlined ------------------------------------ */
a,
.login-pf a {
    color: var(--san-action-teal);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}

/* General link hover — no !important, so higher-specificity button rules (e.g. the
   secondary pill's red hover) can override it by specificity alone. */
a:hover,
.c-pb:hover,
.login-pf a:hover {
    color: var(--san-action-teal-hover);
}

/* .c-pb / .blue-text carry a base `color: teal !important`, so their hover needs
   !important too to darken. */
.c-pb:hover,
.blue-text:hover {
    color: var(--san-action-teal-hover) !important;
}

a:focus,
.login-pf a:focus {
    color: var(--san-action-teal);
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue);
}

/* Link-styled buttons (e.g. the in-page "contact us") should focus like real links —
   the blue focus ring, not nbs's teal outline. */
.link-styling:focus,
.in-page-contact-us-button:focus {
    color: var(--san-action-teal);
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue);
}

.c-pb {
    font-weight: 700;
}

/* nbs uses .c-pb (Primary-Blue) on in-page links — keep them teal for Santander. */
.c-pb,
.blue-text {
    color: var(--san-action-teal) !important;
}

/* ---- Form labels & inputs --------------------------------------------- */
.ice-text-label {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--san-text-default);
}

.ice-text-input {
    border: 1px solid var(--san-border-default);
    border-radius: 8px;
    height: 48px;
    padding: 0 12px;
    box-sizing: border-box;
}

/* Component-library input states (Figma node 198:2399) — override the inherited
   nbs blue/teal glow rings and pink error fill. box-sizing:border-box above keeps the
   1px<->2px border swap from shifting layout. */
.ice-text-input:hover:not(:focus) {
    border-color: var(--san-border-hover);
    box-shadow: none;
}

.ice-text-input:focus {
    border: 2px solid var(--san-action-teal);
    box-shadow: none;
}

/* Error: red border on a WHITE field (the pink #FEE5E5 is only the alert box).
   Drop the inherited nbs 4px red left-bar + 32px indent on the wrapper — the component
   library error is just the field border + inline message. */
.ice-input-error {
    border-left: none;
    padding-left: 0;
}

.ice-input-error .ice-text-input {
    border: 1px solid var(--san-error);
    background: var(--san-surface-flat);
}

.ice-input-error .ice-text-input:hover:not(:focus) {
    border: 1px solid var(--san-error);
    box-shadow: none;
}

.ice-input-error .ice-text-input:focus {
    border: 2px solid var(--san-error);
    box-shadow: none;
}

/* Inline field error message — red text + Santander RD120 error icon (20px),
   icon and text centred with a 4px gap (component-library node 60:1718). */
.ice-input-error .pf-m-error {
    color: var(--san-error);
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    align-items: center;
    gap: 4px;
}

.ice-input-error .pf-m-error b {
    color: var(--san-error);
    font-weight: 700;
}

.pf-m-error::before {
    content: url("../img/san-field-error.svg");
    margin-right: 0;
}

/* ---- Radio buttons (T&C accept) --------------------------------------- */
/* Match the Santander portal (ui/santander/radio/SanRadioIcon.css): 24px circle,
   1px #8F8F8F ring on white; hover #222; focus blue ring; checked = 2px teal ring
   + 12px teal centre dot; checked+hover teal-hover; error red. The portal paints
   the icon on a separate <div>; the register page uses native <input>+<label>, so
   the same look is reproduced directly on the input with a ::after dot. Overrides
   the inherited nbs radio styling (28px, filled 10px checked border, teal glow). */
.radio-buttons > input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    margin: 0 8px 0 0;
    border: 1px solid var(--san-border-default);
    border-radius: 50%;
    background: var(--san-surface-flat);
    position: relative;
    cursor: pointer;
}

.radio-buttons > input[type="radio"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
}

.radio-buttons > input[type="radio"]:hover {
    border-color: var(--san-border-hover);
    box-shadow: none;
}

.radio-buttons > input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue);
}

.radio-buttons > input[type="radio"]:checked {
    border: 2px solid var(--san-action-teal);
}

.radio-buttons > input[type="radio"]:checked::after {
    background: var(--san-action-teal);
}

.radio-buttons > input[type="radio"]:checked:hover {
    border-color: var(--san-action-teal-hover);
}

.radio-buttons > input[type="radio"]:checked:hover::after {
    background: var(--san-action-teal-hover);
}

/* Error — the inline JS adds .ice-input-error to the #toc-input-group fieldset. */
.ice-input-error .radio-buttons > input[type="radio"] {
    border-color: var(--san-error);
}

.ice-input-error .radio-buttons > input[type="radio"]:checked::after {
    background: var(--san-error);
}

/* ---- Buttons ----------------------------------------------------------- */
/* Sizing shared by primary + secondary (Figma: 16px text, 48px tall, 136px min
   width, 20px side padding). Overrides the inherited 20px/28px text and 6px 24px
   padding from .pf-c-button so the pill isn't crowded by oversized text. */
.pf-c-button.pf-m-primary,
.pf-c-button.kc-m-secondary {
    font-size: 16px;
    line-height: 24px;
    min-width: 136px;
    padding: 0 20px;
}

/* Primary: solid red pill, white text, raised elevation. */
.pf-c-button.pf-m-primary {
    background: var(--san-action-red);
    color: var(--san-surface-flat);
    border-radius: 50px;
    min-height: 48px;
    font-weight: 700;
    box-shadow: 0 1px 6px var(--san-shadow);
}

.pf-c-button.pf-m-primary:not([disabled]):hover {
    background: var(--san-action-red-hover);
    box-shadow: 0 1px 6px var(--san-shadow);
}

.pf-c-button.pf-m-primary:not([disabled]):focus {
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue), 0 1px 6px var(--san-shadow);
}

.pf-c-button.pf-m-primary[disabled] {
    color: var(--san-text-disabled);
    background-color: var(--san-surface-disabled);
    box-shadow: none;
}

/* Secondary: white pill, red text, relies on elevation (no border). */
.pf-c-button.kc-m-secondary {
    background: var(--san-surface-flat);
    color: var(--san-action-red);
    border: none;
    border-radius: 50px;
    min-height: 48px;
    font-weight: 700;
    box-shadow: 0 1px 6px var(--san-shadow);
    text-decoration: none;
}

.pf-c-button.kc-m-secondary:not([disabled]):hover {
    color: var(--san-action-red-hover);
    box-shadow: 0 1px 6px var(--san-shadow);
    background: #F6F6F6;
}

.pf-c-button.kc-m-secondary:not([disabled]):focus {
    color: var(--san-action-red);
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue), 0 1px 6px var(--san-shadow);
    border-radius: 50px;
}

.back-to-login-button:focus,
.back-to-login-button:hover {
    color: var(--san-action-teal) !important;
}

.form-group {
    margin: 40px 0;
    max-width: 684px;
}

.form-footer-links {
    display: flex;
    flex-direction: column;
    align-items: start;
    margin-top: 16px;
    gap: 16px;
}

.login-forgot-password {
    margin: 12px 0
}

/* ---- Alerts ------------------------------------------------------------ */
/* Alert title text: Santander Micro Text 16/24, #222 (nbs inherits a 20px title). */
.pf-c-alert__title {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    color: var(--san-text-default);
}

.pf-c-alert {
    padding: 24px;
}

/* Danger/error alert — Figma node 1505:83260: #FEE5E5 surface, red (#990000)
   triangle-exclamation icon. */
.pf-c-alert.pf-m-inline.pf-m-danger {
    background: var(--san-background-error);
}

.pf-c-alert.pf-m-danger .pf-c-alert__title::before {
    background-image: url("../img/san-error.svg");
    background-repeat: no-repeat;
    content: "";
    flex-shrink: 0;
}

.pf-c-alert.pf-m-inline.pf-m-confirmation {
    background: var(--san-background-success);
}

.pf-c-alert.pf-m-confirmation .pf-c-alert__title::before {
    background-image: url("../img/san-tick.svg");
    background-repeat: no-repeat;
    content: "";
}

/* ==========================================================================
   Registration + email-verification (AVP-5261).
   ========================================================================== */
:root {
    --san-background-info: #F5F9FB;     /* Figma color/background/info  */
    --san-icon-info: #257FA4;           /* Figma color/icon/info        */
    --san-background-warning: #FFFAEB;  /* Figma color/background/warning */
    --san-icon-warning: #856300;        /* Figma color/icon/warning     */
    --san-background-success: #F0F8F0;  /* Figma color/background/success */
    --san-icon-success: #008035;        /* Figma color/icon/success     */
}

/* ---- Register: benefits list (Figma "list" frame: 16px rhythm throughout,
   24px rows, no trailing margin on the <ul>). ---------------------------- */
#kc-register-form h2 {
    font-size: 32px;
    line-height: 40px;
    margin: 0 0 16px;
}

/* Intro line ("With My Home Cover you can:") — 16px above the list. */
#kc-register-form .fw-400 > p {
    margin: 0 0 16px;
}

#kc-register-form .ul-success {
    margin: 0;
}

#kc-register-form .ul-success li + li {
    margin-top: 16px;
}

/* Field-to-field spacing is 24px on the registration Figma (desktop + mobile),
   tighter than the shared .form-group 40px/32px rhythm. Applied via a dedicated
   register-only class (NOT by overriding .form-group) so the login page keeps its
   own rhythm; the scope adds specificity to win over the .form-group margins at
   all breakpoints. Adjacent margins collapse to 24px. The buttons wrapper keeps
   .form-group's 40px, matching the Figma gap before the button set. */
#kc-register-form .san-register-field {
    margin: 24px 0;
}

/* Benefits tick: Santander light-circle (#F0F8F0) with green ring + check
   (Figma symblo=tick, background=true), replacing the inherited solid nbs icon.
   Drop the inherited 8px bottom margin so each row is a clean 24px. */
.green-tick-bullet {
    content: url("../img/san-tick.svg");
    margin-bottom: 0;
}

/* Reset the browser-default fieldset padding/border so the DOB + T&C fieldsets
   sit flush-left, aligned with the <div>-based fields. */
#kc-register-form fieldset {
    padding: 0;
    border: 0;
    min-inline-size: 0;
}

#kc-register-form legend {
    padding: 0;
}

/* T&C caption reads as a field label (Santander Micro Text SemiBold 18/24). */
#termsAndConditions-caption {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--san-text-default);
    margin-bottom: 24px;
}

/* ---- Register: date-of-birth (Figma node 1247:63444) ------------------- */
/* Three labelled columns (Day 86 / Month 96 / Year 96) with a 16px gutter,
   overriding the inherited nbs single-row 8px/centred layout. */
.dob-helper {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    color: var(--san-text-default);
    margin: 8px 0 12px;
}

.date-selection {
    gap: 16px;
    align-items: flex-start;
    flex-wrap: nowrap;
    max-width: 320px;
}

.date-selection > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Fixed box widths (Day 86 / Month 96 / Year 96) that don't shrink. The `flex`
   basis is set on the same :nth-child selectors the inherited ice-digital rules
   use, so these win the cascade (equal specificity, loaded later). */
.date-selection > :nth-child(1) {
    flex: 1 0 0;
}

.date-selection > :nth-child(2),
.date-selection > :nth-child(3) {
    flex: 1 0 0;
}

.date-selection input {
    width: 100%;
    text-align: left;
}

.dob-part-label {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: var(--san-text-default);
    margin: 0;
    /* Match Figma: labels stay on one line and may overflow the fixed box width
       into the 16px column gap, so the three inputs stay top-aligned. */
    white-space: nowrap;
}


/* The note sits between the Password label and the input; tighten the inherited
   32px create-password-rules margin to the Figma 8px/12px rhythm. */
#password-input-group .create-password-rules {
    margin: 0 0 12px;
}

.w-cwd {
    max-width: 684px;
}

/* ---- Email verification / confirmation alert (Figma node 1247:64917) --- */
/* Cream warning box + amber triangle, overriding the inherited peach alert.
   Shared by the forgot-password "email sent" + "expired action" alerts on
   sibling pages (currently unstyled for Santander — this is their first skin). */
.alert-expired-action {
    background: var(--san-background-warning);
    padding: 24px;
    font-size: 16px;
    line-height: 24px;
    color: var(--san-text-default);
    align-items: flex-start;
    gap: 8px;
}

.alert-expired-action p,
.alert-expired-action div {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 0;
}

.alert-expired-action::before {
    content: url("../img/san-warning.svg");
}

/* The confirmation heading is <p class="blue-text"><b>…</b></p>; force it to
   #222 bold — outranks the shared `.blue-text → teal !important` link rule. */
.alert-expired-action p.blue-text {
    color: var(--san-text-default) !important;
    font-weight: 700;
    margin-bottom: 8px;
}

.forgot-password-email-sent-confirmation-container p:not(.blue-text) {
    margin-bottom: 24px;
}

#kc-reset-password-form #kc-form-options.forgot-password-back-to-login-margin {
    margin-top: 28px;
}

#kc-reset-password-form .form-footer-links {
    margin-top: 28px;
}

#kc-passwd-update-form .form-reset-password-buttons {
    gap: 28px;
}

.email-verification-resend-text {
    margin-top: 40px;
}

.w-320 {
    width: 320px;
}

.nbs-password-tip-list-padding {
    margin-left: 12px;
    margin-bottom: 0;
}

/* Mobile: buttons stack full-width with the primary "Create my account" on top
   (DOM order is secondary-first, so reverse it). Desktop keeps the inherited
   row: secondary left, primary right. */
@media (max-width: 762px) {
    #kc-form-buttons {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    #kc-form-buttons > * {
        width: 100%;
        justify-content: center;
    }

    /* Register fields fill the content column on mobile (Figma: 343px = 375 frame
       minus the 16px side gutters). Desktop keeps the fixed 320px (.w-320 above). */
    .w-320 {
        width: 100%;
    }

    .email-verification-resend-text {
        margin-top: 32px;
    }
}

/* MFA / two-step verification */

#kc-select-mfa-form,
#kc-email-otp-login-form,
#kc-sms-code-login-form,
#kc-otp-login-form,
#kc-totp-settings-form,
#kc-confirm-mfa-form,
#kc-totp-settings {
    max-width: 684px;
}

.info-box {
    background-color: var(--san-background-info);
    padding: 24px;
    margin: 40px 0;
}

.info-box::before {
    content: url("../img/san-info.svg");
}

.choose-mfa-info-box-heading {
    display: block;
    margin-bottom: 8px;
}

.san-note-box {
    background-color: var(--san-background-info);
    padding: 24px;
    align-items: flex-start;
    margin: 0;
}

.san-note-box::before {
    content: url("../img/san-info.svg");
}

#mfaOptions-input-group {
    padding: 0;
    border: 0;
    margin: 0;
    min-inline-size: 0;
}

#mfaOptions-caption {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--san-text-default);
}

.mfa-radio-container {
    gap: 8px;
}

.mfa-radio-container .radio-buttons {
    align-items: flex-start;
    padding: 12px 0;
}

.page-bottom-button-panel,
.vertical-button-panel,
.vertical-button-panel.new-line-padding {
    gap: 16px;
    margin-top: 40px;
}


#codeInputGroup .ice-text-input,
#phone-number-input-group .ice-text-input,
#otp {
    max-width: 280px;
    width: 100%;
}

#kc-email-otp-login-form .form-group,
#kc-sms-code-login-form .form-group {
    margin: 24px 0;
}

#kc-email-otp-login-form > p,
#kc-sms-code-login-form > p {
    margin: 0;
}

#resendEmailCode,
#resendSmsCode {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 0;
}

.vertical-button-panel .link-styling,
#kc-totp-settings .topt-list a.link-styling {
    display: inline-block;
    padding: 12px 0;
}

.topt-list {
    margin-left: 28px;
}

#kc-totp-settings > .topt-list {
    font-family: var(--title-font-family);
    font-size: 28px;
    line-height: 36px;
    font-weight: 400;
    color: var(--san-text-default);
}

#kc-totp-settings .topt-list ul,
#kc-totp-settings .topt-list p,
#kc-totp-settings .topt-list a,
#kc-totp-settings #kc-totp-secret-key {
    font-family: var(--pf-global--FontFamily--sans-serif);
    font-size: 16px;
    line-height: 24px;
}

#kc-totp-settings .topt-list:not(:first-of-type) {
    margin-top: 40px;
}

#kc-totp-settings .topt-supported-apps {
    margin-top: 16px;
}

#kc-totp-settings .topt-list ul li + li {
    margin-top: 8px;
}

/* bold labels, values keep .fw-400 */
#kc-totp-type,
#kc-totp-algorithm,
#kc-totp-digits,
#kc-totp-period,
#kc-totp-counter {
    font-weight: 700;
}

#kc-totp-secret-qr-code {
    padding: 16px;
    background: var(--san-surface-flat);
    border-radius: 8px;
}

#kc-totp-secret-key {
    background: var(--san-background-info);
    border: none;
    border-radius: 8px;
    padding: 16px;
    max-width: fit-content;
}

#totp-input-group {
    margin-top: 16px;
    margin-bottom: 40px;
}

.popup {
    max-width: 800px;
    box-shadow: 0 1px 10px var(--san-shadow);
}

/* The popup is programmatically focused on open (tabindex="-1"). */
.popup:focus {
    box-shadow: 0 0 0 2px var(--san-surface-flat), 0 0 0 4px var(--san-focus-blue), 0 1px 10px var(--san-shadow);
    outline: none;
}

.popupPadding {
    padding: 24px;
}

/* No divider under the title: drop the inherited popupContent top border and
   its 24px top padding so the content sits 24px below the title */
.popup .popupContent {
    border-top: none;
    padding-top: 0;
    font-size: 16px;
    line-height: 24px;
}

/* In-modal notification text is #222 (Figma), overriding the shared
   `.c-pb { color: teal !important }` link colour that the alert title carries. */
.popupContent .pf-c-alert__title,
.popupContent .pf-c-alert__title .c-pb {
    color: var(--san-text-default) !important;
}

.popupTitle > div[id],
.popupTitle > h2 {
    font-family: var(--title-font-family);
    font-size: 36px;
    line-height: 44px;
    font-weight: 400;
    color: var(--san-text-default);
    margin: 0;
}

.popupTitle {
    align-items: flex-start;
}

.popupCloseButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    background: none;
    border-radius: 50%;
    line-height: 0;
    cursor: pointer;
}

.popupCloseButton:hover {
    background: var(--san-surface-disabled);
}

.popupCloseButton img {
    width: 14px;
    height: 14px;
}

.pf-c-alert.remove-margin {
    margin: 0;
}

.popupContent .fw-700 {
    font-weight: 700;
}

.popupContent .standard-font-size {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 24px;
}

.popupContent .standard-font-size:last-child {
    margin-bottom: 0;
}

.popupContent br {
    display: none;
}


.popup-button-container {
    gap: 16px;
}

#timeoutModal .popup p {
    font-size: 18px;
    line-height: 24px;
}

#timeoutModal .popup p:last-of-type {
    margin-bottom: 0;
}


#timeoutModal #kc-form-buttons {
    gap: 16px;
    margin-top: 0;
}

/* ---- Footer-link modal content (AVP-5744) ------------------------------ */
.popupContent .san-modal-section > p,
.popupContent .san-modal-section > ul {
    margin: 0;
}

.popupContent .san-modal-section + .san-modal-section {
    margin-top: 24px;
}

.popupContent .san-modal-lead {
    font-size: 18px;
    line-height: 24px;
}

.popupContent .san-modal-callout {
    font-family: var(--title-font-family);
    font-size: 28px;
    line-height: 36px;
    font-weight: 400;
    color: var(--san-text-default);
    margin: 0 0 24px;
}

.popupCloseButton {
    color: var(--san-text-default);
}

/* ---- MFA responsive ---------------------------------------------------- */
@media (max-width: 762px) {

    .popup .popupPadding {
        padding-top: 24px;
    }

    .page-bottom-button-panel,
    .vertical-button-panel {
        align-items: stretch;
    }

    .page-bottom-button-panel > *,
    .vertical-button-panel > *,
    .popup-button-container > * {
        width: 100%;
        justify-content: center;
    }

    /* Short inputs go full-width on mobile (Figma). */
    #codeInputGroup .ice-text-input,
    #phone-number-input-group .ice-text-input,
    #otp {
        max-width: none;
    }

    .modal-container {
        padding: 16px;
    }

    .popup {
        border-radius: 8px;
        box-shadow: 0 1px 10px var(--san-shadow);
        height: auto;
    }

    .popupTitle > div[id],
    .popupTitle > h2 {
        font-size: 28px;
        line-height: 36px;
    }

    .popupContent .san-modal-callout {
        font-size: 24px;
        line-height: 32px;
    }
}

/* ==========================================================================
   Footer — white links/legal section + a red brand bar with the white logo.
   The markup is provided by the overridden footer.ftl; these rules style it and
   neutralise the inherited dark-blue #kc-footer background.
   ========================================================================== */
#kc-footer {
    background: var(--san-surface-flat);
    color: var(--san-text-default);
    border-top: 1px solid #CEDEE7;
}

.san-footer {
    display: flex;
    flex-direction: column;
    align-content: start;
    line-height: 24px;
}

.san-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    padding: 32px 0;
}

.san-footer-links > * {
    color: var(--san-action-teal);
    font-weight: 700;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    text-align: start;
    cursor: pointer;
}

.san-footer-links > *:hover {
    color: var(--san-action-teal-hover);
}

.san-footer-legal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0 16px;
    color: var(--san-text-default);
    font-size: 16px;
    line-height: 24px;
}

.san-footer-legal a {
    font-weight: 400;
    color: inherit;
    text-decoration: none;
}

/* Red brand bar (full-width) with the white logo + copyright.
   Horizontal insets come from .san-footer-brand-inner (shared container rule) so the
   logo lines up with the page content; the bar itself only pads vertically. */
.san-footer-brand-bar {
    width: 100%;
    background: var(--san-action-red);
    display: flex;
    justify-content: center;
    padding: 16px 0;
    box-sizing: border-box;
}

.san-footer-brand-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.san-footer-brand-inner img {
    height: 24px;
    width: auto;
}

.san-footer-copyright {
    color: var(--san-surface-flat);
    font-size: 16px;
    line-height: 24px;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 762px) {

    .pf-c-alert{
        margin: 32px 0;
    }

    /* Santander uses one logo everywhere — keep the desktop header image on mobile
       instead of swapping to a separate mobile logo (overrides the nbs swap). */
    #kc-header-img {
        display: block;
    }

    #kc-header-img-mobile {
        display: none;
    }

    #kc-content {
        padding-bottom: 32px;
    }

    #kc-content-wrapper {
        margin-top: 32px;
    }

    .login-pf-page .login-pf-page-header {
        margin-bottom: 32px;
    }

    h1,
    #kc-page-title {
        font-size: 42px;
        line-height: 52px;
    }

    h2 {
        font-size: 32px;
        line-height: 40px;
    }

    h3 {
        font-size: 28px;
        line-height: 36px;
    }

    h4 {
        font-size: 24px;
        line-height: 32px;
    }

    h5 {
        font-size: 20px;
        line-height: 24px;
    }

    .pf-c-alert {
        padding: 16px;
    }

    /* Figma mobile uses a 32px vertical rhythm (desktop is 40px). */
    .form-group {
        margin: 32px 0;
    }

    /* The 16px side inset now comes from the shared container rule on <main>, so drop
       the nbs mobile card padding (20px) to avoid a double gutter. */
    .login-pf-page .card-pf {
        padding-left: 0;
        padding-right: 0;
    }

    .san-footer-links {
        justify-content: center;
    }

    .san-footer-brand-bar {
        padding: 18px 0 24px;
    }

    .san-footer-brand-inner {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .san-footer-copyright {
        white-space: normal;
        text-align: center;
    }
}
