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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background: #fff;
}

/* MudBlazor gives body a 0.00938em letter-spacing that everything inherits; legacy has none, and
   the extra width wraps copy that fits there (e.g. the tariff card descriptions). */
html body {
    letter-spacing: normal;
}

/* Override MudBlazor font */
:root {
    --mud-typography-default-family: 'Poppins', sans-serif;
    /* Shared focus ring: 3px orange halo, meets WCAG 2.4.7 3:1 contrast ratio
       against both #ffffff and #0F1A38 backgrounds */
    --focus-ring: 0 0 0 3px #EA774D;
}
.mud-typography, .mud-input, .mud-button-root { font-family: 'Poppins', sans-serif !important; }

/* Remove MudBlazor default body padding */
.mud-layout { padding: 0 !important; }

/* ── Shared step form styles (reused across all registration steps) ── */
.step-heading {
    font-size: 40px;
    font-weight: 500;
    color: #1A1F3C;
    margin: 0;
    line-height: 1.125;
}

.step-desc {
    font-size: 18px;
    color: #0F1A38;
    margin: 16px 0;
    line-height: 1.5;
}

@media only screen and (max-width: 768px) {
    .step-heading {
        font-size: 28px;
    }
}

@media only screen and (max-width: 480px) {
    .step-heading {
        font-size: 22px;
        padding-left: 0;
    }
}


.btn-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-next {
    flex: 1;
}


/* ── "Siguiente" / submit button overrides ──
   Source: https://contratar-dev.chippio.es (button styled component ol)
   Target values:
     height        : 60px desktop / 40px ≤768px
     border-radius : 30px
     padding       : 10px 30px
     bg (enabled)  : #DF6437
     bg (disabled) : #E9E0D1
     hover         : #ea774d
     active        : #bc532d
     font          : Poppins 400 16px, color #ffffff
*/
.btn-next.mud-button-root {
    height: 60px !important;
    border-radius: 30px !important;
    padding: 10px 30px !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 20px !important;
    color: #ffffff !important;
    background-color: #DF6437 !important;
    border: none !important;
    text-transform: none !important;
    transition: background-color 0.15s ease-in-out !important;
}

/* MudBlazor applies text-transform on the inner label span, not the root */
.btn-next .mud-button-label {
    text-transform: none !important;
}

.btn-next.mud-button-root:hover:not(:disabled) {
    background-color: #ea774d !important;
}

.btn-next.mud-button-root:active:not(:disabled) {
    background-color: #bc532d !important;
}

.btn-next.mud-button-root:disabled,
.btn-next.mud-button-root.mud-button-disable {
    background-color: #E9E0D1 !important;
    color: #ffffff !important;
}

@media only screen and (max-width: 768px) {
    .btn-next.mud-button-root {
        height: 40px !important;
        font-size: 14px !important;
    }

    .btn-back {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ── TariffSelectorPanel inside drawer: reset the desktop panel padding ──
   The drawer already provides 64px 20px 24px 20px inner padding,
   so the panel should have no additional padding there.
*/
.tariff-drawer-inner .tariff-panel {
    padding: 0 !important;
    height: auto !important;
}


/* Legacy (MUI FormControlLabel -11px): the box lines up with the field labels. */
.cb-midnight {
    margin-left: -11px !important;
}

.cb-midnight .mud-button-root {
    color: #0F1A38 !important;
    padding: 9px !important;
    margin-right: 12px !important;
}

/* Legacy StyledLink: brand orange, underlined on hover only. */
.cb-link {
    color: #DF6437;
    text-decoration: none;
}

.cb-link:hover {
    text-decoration: underline;
}

/* Legacy CheckboxMui: 32px box. */
.cb-midnight .mud-svg-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 32px !important;
}


/* ── Back button (circular arrow, all steps) ── */
.btn-back {
    /* Legacy BackButton: 55px circle, 1px border, arrow_back.svg (40px on phones). */
    width: 55px;
    height: 55px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #0F1A38;
    background: transparent;
    color: #0F1A38;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

/* Legacy's back button has no hover fill (it would also hide the navy SVG arrow). */


/* ── MudBlazor MessageBox / Dialog overrides ──
   Used by IDialogService.ShowMessageBox(...) confirmation dialogs.
   Keeps the brand language: rounded card, pill-shaped action buttons,
   midnight-blue cancel + brand-orange primary. */
.mud-dialog {
    border-radius: 16px !important;
    font-family: 'Poppins', sans-serif !important;
}

.mud-dialog-title {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
    color: #0F1A38 !important;
}

.mud-dialog-content {
    font-family: 'Poppins', sans-serif !important;
    color: #555 !important;
}

.mud-dialog-actions {
    padding: 16px 24px 20px 24px !important;
    gap: 16px !important;
}

/* Belt-and-braces: also space siblings in case the gap rule is overridden */
.mud-dialog-actions .mud-button-root + .mud-button-root {
    margin-left: 16px !important;
}

/* ShowMessageBox renders both buttons as Variant.Text. We override the styling
   to make them look like the canonical CTA pattern (.btn-validar / .btn-next).
   Distinguish primary vs cancel via .mud-button-text-primary (Yes button has
   Color.Primary set; Cancel button has no color). */

/* Base shape applied to BOTH buttons — slightly shorter than the page CTA
   (which is 60px) since dialog actions are visually subordinate to in-form CTAs. */
.mud-dialog-actions .mud-button-root {
    height: 48px !important;
    min-width: 120px !important;
    padding: 0 28px !important;
    border-radius: 24px !important;
    text-transform: none !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    line-height: 20px !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mud-dialog-actions .mud-button-root .mud-button-label {
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: 16px !important;
}

/* Primary "Eliminar" — text-primary variant, repaint as solid orange CTA */
.mud-dialog-actions .mud-button-text-primary {
    background-color: #DF6437 !important;
    color: #ffffff !important;
    border: none !important;
}

.mud-dialog-actions .mud-button-text-primary .mud-button-label {
    color: #ffffff !important;
}

.mud-dialog-actions .mud-button-text-primary:hover {
    background-color: #ea774d !important;
}

.mud-dialog-actions .mud-button-text-primary:active {
    background-color: #bc532d !important;
}

/* Cancel "Cancelar" — text variant (no primary), repaint as outlined midnight blue.
   Selector excludes -primary so it doesn't fight with the rule above. */
.mud-dialog-actions .mud-button-text:not(.mud-button-text-primary) {
    color: #0F1A38 !important;
    border: 1.5px solid #0F1A38 !important;
    background: transparent !important;
}

.mud-dialog-actions .mud-button-text:not(.mud-button-text-primary):hover {
    background: #0F1A38 !important;
    color: #ffffff !important;
}

.mud-dialog-actions .mud-button-text:not(.mud-button-text-primary) .mud-button-label {
    color: inherit !important;
}

@media only screen and (max-width: 768px) {
    .mud-dialog-actions .mud-button-root {
        height: 40px !important;
        font-size: 14px !important;
        min-width: 100px !important;
        padding: 0 22px !important;
    }
}

/* ── Focus-visible rings ──
   Use :focus-visible so the ring only appears for keyboard / AT navigation,
   not for mouse clicks. All custom interactive elements use --focus-ring. */

.btn-next.mud-button-root:focus-visible {
    outline: none !important;
    box-shadow: var(--focus-ring) !important;
}

.btn-back:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.mud-dialog-actions .mud-button-root:focus-visible {
    outline: none !important;
    box-shadow: var(--focus-ring) !important;
}

/* ── Select popover item styles ──
   MudSelect items render inside the teleported MudPopover at the app root,
   so these cannot live in component-scoped CSS. */
.capacity-legend {
    font-size: 13px;
    color: #666;
    margin-left: 6px;
}

.capacity-divider {
    font-weight: 600;
    color: #666;
}

/* Action-style option in a data dropdown (e.g. "+ Añadir nueva cuenta bancaria") */
.select-action-item {
    color: #EA774D;
    font-weight: 500;
}

/* Data rows in select popovers: midnight text, neutral hover/selected —
   the theme primary tint made selected data rows look like action rows. */
.mud-popover .mud-list-item {
    color: #0F1A38;
    font-family: 'Poppins', sans-serif;
}
.mud-popover .mud-list-item:hover {
    background-color: #f8f8f8 !important;
}
.mud-popover .mud-list-item.mud-selected-item {
    background-color: #f8f8f8 !important;
    color: #0F1A38 !important;
}
.mud-popover .mud-list-item.mud-selected-item .mud-typography,
.mud-popover .mud-list-item.mud-selected-item.mud-primary-text {
    color: #0F1A38 !important;
}

/* ── Emilia support chat ───────────────────────────────────────────────────
   The widget's loader (embed.js, App.razor) draws its own button and panel in a shadow
   root, so only where it shows is decided here. Legacy parity: not on phones and tablets,
   where it would sit on top of the wizard's fixed footer controls.                  */
@media screen and (max-width: 1023px) {
    #emilia-widget {
        display: none;
    }
}

/* FocusOnNavigate moves focus to the page's h1 (tabindex -1) for screen readers; legacy shows
   no outline there, and a programmatic focus target isn't something to click. */
h1[tabindex="-1"]:focus {
    outline: none;
}

/* Legacy's OneTrust filter blur (index.html): the page behind the cookie preference centre. */
.onetrust-pc-dark-filter {
    -webkit-filter: blur(5px);
    filter: blur(5px);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transform: scale(1.1);
}
