/* ==========================================================
   AUTH PAGES (login / register / password recovery)
   Professional centered card. Scoped to body:is(.page-authentication, .page-registration)
   so it never affects other customer-account pages.
   ========================================================== */

body:is(.page-authentication, .page-registration) #wrapper {
    background-color: #f5f7fa;
}

/* Tighten the page-title banner a touch */
body:is(.page-authentication, .page-registration) .page-title-wrapper .page-header h1 {
    font-weight: 700;
    color: #253237;
}

/* ---- the card ---- */
body:is(.page-authentication, .page-registration) #content.page-content {
    max-width: 460px;
    margin: 8px auto 40px;
    padding: 32px 30px 28px;
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(37, 50, 55, 0.08);
}

/* Card intro heading (rendered via CSS so no template change needed) */
body:is(.page-authentication, .page-registration) #content.page-content::before {
    content: "Welcome back";
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #253237;
    text-align: center;
    margin-bottom: 4px;
}

body.page-registration #content.page-content::before {
    content: "Create your account";
}

body:is(.page-authentication, .page-registration) #content.page-content > .login-form::before,
body:is(.page-authentication, .page-registration) #content.page-content > .register-form::before {
    content: "Enter your details to continue";
    display: block;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0 0 22px;
}

/* ---- stack the bootstrap horizontal rows ---- */
body:is(.page-authentication, .page-registration) .form-group.row {
    display: block;
    margin: 0 0 18px;
}

body:is(.page-authentication, .page-registration) .form-group.row label.form-control-label {
    display: block;
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0 0 6px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #253237;
}

body:is(.page-authentication, .page-registration) .form-group .col-md-8,
body:is(.page-authentication, .page-registration) .form-group [class*="col-md"] {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0;
}

body:is(.page-authentication, .page-registration) .form-group .form-control-comment {
    display: none;
}

body:is(.page-authentication, .page-registration) .form-group .form-control-comment:not(:empty) {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ---- inputs ---- */
body:is(.page-authentication, .page-registration) .form-control,
body:is(.page-authentication, .page-registration) select.form-control {
    height: 46px;
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e7ec;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #253237;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body:is(.page-authentication, .page-registration) textarea.form-control {
    height: auto;
}

body:is(.page-authentication, .page-registration) .form-control:focus {
    border-color: #80b435;
    box-shadow: 0 0 0 3px rgba(128, 180, 53, 0.15);
    outline: none;
}

/* ---- password field with Show/Hide ----
   The theme renders input-groups with the OLD Bootstrap table model
   (.input-group{display:table}, .form-control{display:table-cell;float:left;
   width:100%}, .input-group-btn{display:table-cell;width:1%}). Changing only
   width left the input as a floated table-cell, so the button overflowed.
   Fully switch the group to flexbox and reset the children. */
body:is(.page-authentication, .page-registration) .input-group {
    display: flex !important;
    width: 100%;
    border-collapse: initial;
}

body:is(.page-authentication, .page-registration) .input-group > .form-control {
    display: block;
    float: none;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

body:is(.page-authentication, .page-registration) .input-group > .input-group-btn {
    display: flex;
    float: none;
    width: auto;
    flex: 0 0 auto;
}

body:is(.page-authentication, .page-registration) .input-group .input-group-btn .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

body:is(.page-authentication, .page-registration) .input-group .input-group-btn .btn {
    height: 46px;
    padding: 0 16px;
    border: 1px solid #e2e7ec;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #f5f7fa;
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

body:is(.page-authentication, .page-registration) .input-group .input-group-btn .btn:hover {
    background: #eef1f4;
    color: #253237;
}

/* ---- forgot password ---- */
body:is(.page-authentication, .page-registration) .forgot-password {
    text-align: right;
    margin: -6px 0 20px;
    padding: 0;
}

body:is(.page-authentication, .page-registration) .forgot-password a {
    color: #6a9a2d;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

body:is(.page-authentication, .page-registration) .forgot-password a:hover {
    text-decoration: underline;
}

/* ---- primary submit button ---- */
body:is(.page-authentication, .page-registration) .form-footer {
    text-align: center;
    margin: 0;
    padding: 0;
}

body:is(.page-authentication, .page-registration) .form-footer .btn-primary,
body:is(.page-authentication, .page-registration) #submit-login,
body:is(.page-authentication, .page-registration) button[data-link-action="sign-in"],
body:is(.page-authentication, .page-registration) button[data-link-action="save-customer"] {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    background: #80b435;
    border: 1px solid #80b435;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

body:is(.page-authentication, .page-registration) .form-footer .btn-primary:hover,
body:is(.page-authentication, .page-registration) #submit-login:hover,
body:is(.page-authentication, .page-registration) button[data-link-action="sign-in"]:hover,
body:is(.page-authentication, .page-registration) button[data-link-action="save-customer"]:hover {
    background: #6a9a2d;
    border-color: #6a9a2d;
    box-shadow: 0 4px 14px rgba(128, 180, 53, 0.32);
    color: #fff;
}

/* ---- divider + "No account? Create one here" as a secondary button ---- */
body:is(.page-authentication, .page-registration) #content.page-content hr {
    border: none;
    border-top: 1px solid #eef1f4;
    margin: 22px 0 18px;
}

body:is(.page-authentication, .page-registration) .no-account {
    text-align: center;
}

body:is(.page-authentication, .page-registration) .no-account a,
body:is(.page-authentication, .page-registration) .login-form .no-account a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    background: #fff;
    color: #253237;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

body:is(.page-authentication, .page-registration) .no-account a:hover {
    border-color: #80b435;
    color: #4e7a1d;
    background: rgba(128, 180, 53, 0.06);
}

/* ---- checkboxes (register page consents) ---- */
body:is(.page-authentication, .page-registration) input[type="checkbox"],
body:is(.page-authentication, .page-registration) input[type="radio"] {
    accent-color: #80b435;
    width: 16px;
    height: 16px;
}

/* ---- consent rows: compact, single line, no stray "*" ----
   Each consent renders an EMPTY <label class="form-control-label required">
   (just a red required "*") plus the real checkbox in .col-md-8. Stacking
   put the lone "*" on its own line. Hide that empty label and tighten. */
body:is(.page-authentication, .page-registration) .form-group.row:has(.custom-checkbox) {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: #fafbfc;
    border: 1px solid #eef1f4;
    border-radius: 8px;
}

body:is(.page-authentication, .page-registration) .form-group.row:has(.custom-checkbox) > label.form-control-label {
    display: none;
}

body:is(.page-authentication, .page-registration) .form-group.row:has(.custom-checkbox) > .col-md-8 {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0;
}

body:is(.page-authentication, .page-registration) .custom-checkbox {
    display: block;
}

/* Keep the native flow layout (checkbox box inline, text after, the
   description <em> on its own line). A flex label split the title and the
   <br><em> description into separate columns, which broke "Customer data
   privacy" / "Sign up for our newsletter". */
body:is(.page-authentication, .page-registration) .custom-checkbox > label {
    display: block;
    margin: 0;
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #253237;
    cursor: pointer;
}

body:is(.page-authentication, .page-registration) .custom-checkbox > label input[type="checkbox"] + span {
    vertical-align: top;
    margin-top: 1px;
}

/* the inline description (rendered as <br><em>…</em> inside the label) */
body:is(.page-authentication, .page-registration) .custom-checkbox > label em {
    display: block;
    margin-top: 3px;
    font-style: normal;
    font-weight: 400;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #9ca3af;
}

/* the separate comment column is empty for consents — hide it */
body:is(.page-authentication, .page-registration) .form-group.row:has(.custom-checkbox) .form-control-comment {
    display: none;
}

/* ---- verification file upload (kbuservalidation) ---- */
body:is(.page-authentication, .page-registration) .kbuv-file-upload {
    background: #fafbfc;
    border: 1px dashed #d7dde3;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

body:is(.page-authentication, .page-registration) .kbuv-file-upload > label.form-control-label {
    display: block;
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #253237;
}

body:is(.page-authentication, .page-registration) .kbuv-file-upload .kbuv-help {
    display: block;
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #6c757d;
}

body:is(.page-authentication, .page-registration) .kbuv-file-upload .col-md-6 {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0;
}

body:is(.page-authentication, .page-registration) .kbuv-file-upload input[type="file"] {
    width: 100%;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #e2e7ec;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ==========================================================
   REGISTER PAGE — wider card + 2-column form
   ========================================================== */
body.page-registration #content.page-content {
    max-width: 900px;
}

/* lay the registration fields out in two columns.
   PrestaShop wraps the fields in an unclassed <div> inside #customer-form,
   so the flex container is that wrapper (#customer-form > div). */
body.page-registration #customer-form > div {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 24px;
}

/* default: any field-wrapper child spans full width (hook blocks like the
   file upload / signup-reward message, etc.) */
body.page-registration #customer-form > div > * {
    flex: 0 0 100%;
    max-width: 100%;
}

/* text / select fields take half width */
body.page-registration #customer-form > div > .form-group.row {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
}

/* …but consents, radios, textareas and file uploads stay full width */
body.page-registration #customer-form > div > .form-group.row:has(input[type="checkbox"]),
body.page-registration #customer-form > div > .form-group.row:has(input[type="radio"]),
body.page-registration #customer-form > div > .form-group.row:has(textarea),
body.page-registration #customer-form > div > .form-group.row:has(input[type="file"]) {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (max-width: 767px) {
    /* single column on small screens */
    body.page-registration #customer-form > div > .form-group.row {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 575px) {
    body:is(.page-authentication, .page-registration) #content.page-content {
        max-width: 100%;
        margin: 8px 12px 30px;
        padding: 24px 20px;
    }
}
