/* ============================================================
   Full-screen login/register wizard (authentication.tpl)
   Reuses the "fullscreen-header" partial markup — any future full-screen
   page can reuse both this header block styling and the .btn-fullscreen /
   .input_wrap patterns below.
   ============================================================ */
body.content_only {
    margin: 0;
    background: #fff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* -------- slim header: back / logo / close -------- */
.fullscreen-header {
    height: 60px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #E8E8E8;
}
.fullscreen-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fullscreen-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1d1e20;
    padding: 0;
    margin-left: -8px;
}
/* order-opc.tpl's "Seguir comprando" caption: stacked above the logo (not
   the arrow), left-aligned to it, within the same 60px header row. */
.fullscreen-logo-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.fullscreen-back-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: #5b6470;
    white-space: nowrap;
}
.fullscreen-logo-link {
    display: block;
    line-height: 0;
}
.fullscreen-logo {
    height: 26px;
    width: auto;
}
.fullscreen-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 1.5px solid #1d1e20;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d1e20;
    flex-shrink: 0;
}
.fullscreen-close-btn:hover {
    background: #1d1e20;
    color: #fff;
}

/* -------- wizard shell --------
   .auth-wizard itself is NEVER width-constrained — the constraint lives on
   .auth-step-inner instead (narrow, 480/560px card) so it applies equally
   whether a step renders normally OR gets swapped in via AJAX afterwards
   (submitFunction() does $('#center_column').html(...) with bare markup —
   that response has no .auth-wizard/.auth-step-inner wrapper of its own, it
   lands straight inside the EXISTING #center_column/.auth-wizard that was
   already on the page). Keeping .auth-wizard itself unconstrained means
   whatever ends up inside #center_column — the narrow mini-wizard card, or
   later the much wider #account-creation_form.fixed_width — has the full
   width available to size itself against, with no ancestor cap to fight. */
.auth-wizard {
    padding: 40px 24px 60px;
    box-sizing: border-box;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}
.auth-step {
    display: none;
    flex: 1;
    flex-direction: column;
}
.auth-step.is-active {
    display: flex;
}
.auth-step-inner {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
/* This step (full registration form, after the quick email step) keeps its
   existing field layout/behavior as-is — only reuses the site's own
   .fixed_width container (990/1240/1360px tiers, see global.css) instead of
   the narrow 480/560px wizard card, so it's not squeezed on desktop.
   Only #account-creation_form itself carries .fixed_width (see the <form>
   tag) — that's what actually matters for the AJAX-swapped case (its
   response has no wrapper of its own, see the note above .auth-wizard).
   This wrapper div (only present for the non-ajax render) stays a plain,
   un-padded pass-through so .fixed_width isn't nested/shrunk twice. */
/* :has() targets the real condition ("this wizard currently holds the full
   registration form") instead of a class that's only present in the
   non-ajax render — so the mobile media query's .auth-wizard{padding:20px}
   (and the base 24px one) get zeroed in the AJAX-swapped case too, where the
   ancestor is actually the mini-wizard's plain .auth-wizard, never
   "-wide". That was the real source of the leftover left/right gutter. */
.auth-wizard.auth-wizard-wide,
.auth-wizard:has(#account-creation_form) {
    padding-left: 0;
    padding-right: 0;
    background: #fff;
}
.auth-step-inner.auth-step-inner-wide {
    max-width: none;
    width: 100%;
}
/* Unconditional (not scoped to .auth-wizard-wide): this is what actually
   shows for the common case, since the AJAX swap lands this form straight
   into the mini-wizard's own #center_column — see the note above — which
   never gets the "-wide" wrapper at all. Just a gutter, matching the other
   steps — no card background/radius, the whole page is white now
   (body.content_only), so a "card" box here would stand out, not blend in. */
#account-creation_form.fixed_width {
    padding: 0 10px;
    box-sizing: border-box;
}
/* .fieldset_content (global.css) adds its own 20px side padding, and the
   mobile media queries there also put a 15-25px side MARGIN on every single
   .control-group — stacked on top of the 24px above, that's what kept
   fields from reaching full width / looking "unglued" from the edges. Both
   are redundant now that the form itself sets the gutter. */
#account-creation_form .fieldset_content {
    padding-left: 0;
    padding-right: 0;
}
#account-creation_form .control-group {
    margin-left: 0;
    margin-right: 0;
}
/* .pcss3f p.input_wrap (global.css) is display:inline-block, so it
   shrink-wraps to its content instead of stretching to the column's width —
   with a shrink-wrapped parent, the input's own width:100% is a circular
   reference the browser can't resolve, so it silently falls back to the
   ~190px browser-default text input width instead. Un-shrink-wrap the
   wrapper first so the column's width is actually there for 100% to use. */
#account-creation_form .input_wrap {
    display: block;
    width: 100%;
}
/* Legacy fixed pixel widths (.input-small 90px, .input-xlarge 205px, bare
   .text 206px from the old Bootstrap-2 reset) made fields an inconsistent
   width — every text/password field in this form now matches its column. */
#account-creation_form input[type="text"],
#account-creation_form input[type="password"] {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
/* This form keeps the .pcss3f/.pcss3f-vm/.pcss3f-type-hor framework classes
   (global.css), which render jquery.validate's <em> as an absolutely
   positioned pink tooltip bubble (.pcss3f-vm em / .pcss3f-type-hor em) and
   give invalid fields a pale pink border+glow (.pcss3f .state-error input) —
   the old validation look. #login_form/#create-account_form never had these
   classes, which is why the simplified border+inline-text pattern already
   worked there without extra overrides. Reapply it here, scoped to this
   form only. */
#account-creation_form em.invalid {
    position: static;
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: normal;
    font-style: normal;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: normal;
    font-weight: 400;
    color: #f06542;
    display: block;
}
#account-creation_form em.invalid:before {
    display: none;
}
#account-creation_form .input_wrap input.invalid,
#account-creation_form .input_wrap select.invalid {
    border-color: #f06542 !important;
    box-shadow: none !important;
}
#account-creation_form .input_wrap input.valid,
#account-creation_form .input_wrap select.valid {
    border-color: #1d9649 !important;
    box-shadow: none !important;
}
/* a.iframe (global.css) is bold site-wide; here it's just "(Leer más)" inside
   the privacy sentence, not its own call-to-action, so it should read as
   part of the sentence rather than stand out. */
#account-creation_form label.checkbox a.iframe {
    font-weight: 400;
}
/* Field labels and radio option text were the small/thin legacy size —
   bump them to match the rest of the wizard's type scale. */
#account-creation_form .control-label {
    font-size: 15px;
    font-weight: 600;
    color: #1d1e20;
}
#account-creation_form label.radio {
    font-size: 15px;
    font-weight: 400;
    color: #1d1e20;
}
#account-creation_form.fixed_width > fieldset.account_creation > h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -.02em;
    color: #1d1e20;
    background: none;
    border-bottom: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 4px;
}
.auth-registration-subtitle {
    margin: -8px 0 16px;
    font-size: 15px;
    color: #5b6470;
}
/* Help text under a field (e.g. "Nº de Colegiado", password hint) — was
   italic/inline by default (.form-horizontal .form_info in global.css); make
   it a plain, muted caption like the rest of the wizard's helper text. */
#account-creation_form .form_info {
    font-style: normal;
    font-size: 13px;
    color: #5b6470;
    margin-top: 6px;
}

/* -------- address form (address.tpl, #add_adress) --------
   Same full-screen treatment as #account-creation_form above: it's reached
   mid-way through the auth -> address -> checkout chain (see
   AuthController::redirectToAddressIfMissing()), so it should read as part
   of the same flow, not drop back into the old boxed-panel look. */
/* Same stacked-padding problem as #account-creation_form: .fieldset_content's
   own 20px side padding, plus a mobile-only 15-25px side MARGIN on every
   .control-group (global.css), left fields indented ~45px from the heading
   above them instead of flush with it. */
/* Unlike #account-creation_form, the .fixed_width gutter here sits on the
   OUTER wrapper (.fullscreen-checkout-content), not on the form itself — so
   the form has no side padding of its own to absorb .row's -15px bootstrap
   margin, and it bleeds straight past the viewport edge (horizontal scroll).
   Give the form the same 10px gutter #account-creation_form.fixed_width has. */
#add_adress {
    padding: 0 10px;
    box-sizing: border-box;
}
#add_adress .fieldset_content {
    padding-left: 0;
    padding-right: 0;
}
#add_adress .control-group {
    margin-left: 0;
    margin-right: 0;
}
#add_adress .input_wrap {
    display: block;
    width: 100%;
}
#add_adress input[type="text"],
#add_adress input[type="password"] {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
#add_adress em.invalid {
    position: static;
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: normal;
    font-style: normal;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: normal;
    font-weight: 400;
    color: #f06542;
    display: block;
}
#add_adress em.invalid:before {
    display: none;
}
#add_adress .input_wrap input.invalid,
#add_adress .input_wrap select.invalid {
    border-color: #f06542 !important;
    box-shadow: none !important;
}
#add_adress .input_wrap input.valid,
#add_adress .input_wrap select.valid {
    border-color: #1d9649 !important;
    box-shadow: none !important;
}
#add_adress .control-label {
    font-size: 15px;
    font-weight: 600;
    color: #1d1e20;
}
/* The "Soy" (customer_invoice_type) options keep their own boxed/pill look
   (.address_options_wrap label, global.css) — no direct equivalent in
   #account-creation_form to match, just bumped to the same type scale. */
.address_options_wrap label {
    font-size: 15px;
    color: #1d1e20;
}
#add_adress fieldset > h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -.02em;
    color: #1d1e20;
    background: none;
    border-bottom: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 4px;
}
#add_adress .form_info {
    font-style: normal;
    font-size: 13px;
    color: #5b6470;
    margin-top: 6px;
}

/* -------- step 1: choose -------- */
.auth-step-choose {
    justify-content: center;
    flex: 1;
}
.auth-choose-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}
.auth-choose-copy h1 {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #1d1e20;
}
.auth-choose-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #5b6470;
}
.auth-choose-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-choose-help {
    margin: 12px 0 0;
    text-align: center;
    font-size: 14px;
    color: #5b6470;
}
.auth-choose-help a {
    color: #1e9de0;
    font-weight: 500;
}

/* -------- step heading (login / register) -------- */
.auth-step-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-step-head h1 {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -.02em;
    color: #1d1e20;
}
.auth-step-head p {
    margin: 0;
    font-size: 15px;
    color: #5b6470;
}

/* -------- forms: email/password fields, reusing .input_wrap -------- */
/* global.css:3778 floats #login_form/#create-account_form at width:49% so the
   old layout could show them side by side. Our forms reuse those same IDs —
   neutralize it here (scoped to .auth-form, so the legacy guest-checkout
   layout that still relies on the 49% columns is untouched). */
#authentication #login_form.auth-form,
#authentication #create-account_form.auth-form {
    float: none;
    clear: both;
    width: 100%;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}
.auth-form .input_wrap {
    display: flex;
    flex-direction: column;
    margin: 0;
    width: 100%;
}
.auth-form .input_wrap label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #1d1e20;
}
/* IDs beat the legacy Bootstrap-2 reset's bare `input{width:206px}`
   (global.css) with certainty, regardless of load order. */
#login_form.auth-form .input_wrap input,
#create-account_form.auth-form .input_wrap input,
.auth-form .input_wrap input {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    padding: 14px 16px;
    color: #1d1e20;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    width: 100% !important;
    max-width: none;
}
.auth-form .input_wrap input:focus {
    border-color: #1e9de0;
    box-shadow: 0 0 0 3px rgba(30, 157, 224, .15);
}
/* The unconditional border above has the same specificity as global.css's
   .input_wrap input.valid/.invalid and loads after it, so it always won —
   these need to be at least as specific to actually show the error/success
   color (jquery.validate adds .valid/.invalid directly on the input). */
.auth-form .input_wrap input.invalid {
    border-color: #f06542 !important;
}
.auth-form .input_wrap input.valid {
    border-color: #1d9649 !important;
}
.auth-form .forgot_link {
    align-self: flex-end;
    font-size: 14px;
    font-weight: 500;
    color: #1e9de0;
    margin-top: -8px;
}
.auth-form #create_account_error {
    margin: 0;
}
.auth-switch {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: #5b6470;
}
.auth-switch a {
    font-weight: 500;
    color: #1e9de0;
    cursor: pointer;
}

/* -------- buttons (pill, matches the brand Button spec) -------- */
.btn-fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    border-radius: 9999px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    font-size: 18px;
    padding: 14px 24px;
    cursor: pointer;
    box-sizing: border-box;
    margin-top: auto;
}
.btn-fullscreen-primary {
    background: #79a8dd;
    color: #fff;
}
.btn-fullscreen-primary:hover {
    background: #c7daf1;
}
.btn-fullscreen-outline {
    background: #fff;
    color: #79a8dd;
    border: 1px solid #79a8dd;
}
.btn-fullscreen-outline:hover {
    background: #eff5fb;
}
.btn-fullscreen-accent {
    background: #ffb400;
    color: #fff;
}
.btn-fullscreen-accent:hover {
    background: #ffe094;
}

@media only screen and (max-width: 520px) {
    /* Fixed so it stays reachable (back/close) while scrolling a tall step
       like the full registration form — taking it out of flow means the
       content below needs its own top padding to clear it instead. */
    .fullscreen-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 50;
    }
    /* Mobile browsers auto-scroll a focused field into view (to clear the
       on-screen keyboard) using native scrollIntoView — which has no idea
       our fixed bottom bar exists, so it lands fields half-hidden behind it
       (e.g. "Teléfono", the field right above the bar). scroll-padding tells
       that native scrolling to treat the bar's height as reserved space,
       same fix for both fixed bars below. */
    html:has(#account-creation_form),
    html:has(#add_adress) {
        scroll-padding-bottom: 96px;
    }
    .auth-wizard {
        padding: 88px 20px 40px;
        min-height: 100vh;
    }
    /* Fixed white bar holding the submit button, reachable without scrolling
       past the privacy checkbox first — :has(#submitAccount) (not just the
       shared .cart_navigation.required.submit class) keeps this off the
       separate guest-checkout form's #submitGuestAccount row. */
    .auth-wizard:has(#account-creation_form) {
        padding-bottom: 96px;
    }
    #account-creation_form .cart_navigation.required.submit:has(#submitAccount) {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 8px 20px;
        background: #fff;
        border-top: 1px solid #E8E8E8;
        z-index: 50;
    }
    #account-creation_form #submitAccount {
        width: 100%;
        margin: 0;
    }
    /* Same fixed bottom bar for address.tpl's save button. */
    .fullscreen-checkout-content:has(#add_adress) {
        padding-bottom: 96px;
    }
    #add_adress .control-group:has(#submitAddress) {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 8px 20px;
        background: #fff;
        border-top: 1px solid #E8E8E8;
        z-index: 50;
    }
    #add_adress .control-group:has(#submitAddress) .controls {
        margin-left: 0;
    }
    #add_adress #submitAddress {
        width: 100%;
        margin: 0;
    }
}

/* Desktop/tablet: the wizard was staying phone-width (480px) and the submit
   button, pushed down with margin-top:auto, ended up stranded at the bottom
   of a tall viewport instead of following the fields. Widen it and let the
   content size to itself (no more flex:1 stretch), vertically centered. */
@media only screen and (min-width: 521px) {
    .auth-wizard {
        min-height: 0;
        padding-top: 64px;
        padding-bottom: 64px;
    }
    .auth-step.is-active {
        flex: none;
    }
    .auth-step-inner {
        max-width: 560px;
        flex: none;
    }
    .auth-step-inner.auth-step-inner-wide {
        max-width: none;
    }
    .auth-step-choose {
        flex: none;
    }
    .auth-choose-copy {
        flex: none;
        margin-bottom: 36px;
    }
    .auth-form {
        flex: none;
    }
    .btn-fullscreen {
        margin-top: 4px;
    }
}

/* Site footer (themes/dentalcost/site-footer.tpl): hidden on mobile, where
   the full-screen flow should stay focused/distraction-free; shown on
   desktop, where the wizard alone leaves too much empty page below it. */
.fullscreen-footer-wrap {
    display: none;
}
@media only screen and (min-width: 521px) {
    .fullscreen-footer-wrap {
        display: block;
        margin-top: 40px;
    }
}
/* order-opc.tpl (checkout) wants its footer on mobile too — unlike the auth
   wizard, it's not a short focused flow, so hiding it there isn't the point. */
.fullscreen-footer-wrap.fullscreen-footer-wrap-visible {
    display: block;
}

/* -------- checkout content (order-opc.tpl) --------
   Only the header is shared chrome here — the actual cart/address/payment
   markup is untouched legacy PrestaShop templates. It also carries the
   site's own .fixed_width class (global.css: 990/1240/1360px tiers, 97% on
   mobile) for horizontal sizing, same as every other page — so only
   vertical padding is needed here. */
.fullscreen-checkout-content {
    padding: 24px 0 40px;
    box-sizing: border-box;
}
@media only screen and (max-width: 520px) {
    /* .fullscreen-header is fixed at this width (see above) — compensate so
       content doesn't start out hidden underneath it. */
    .fullscreen-checkout-content {
        padding-top: 76px;
    }
}
@media only screen and (min-width: 521px) {
    .fullscreen-checkout-content {
        padding: 32px 0 60px;
    }
}
