/* Authentication pages only. Existing header, footer and home styles are untouched. */
.woocommerce-account .am-content-layout {
    width: min(calc(100% - 40px), 1200px);
    padding-top: 0;
    padding-bottom: 72px;
}

.woocommerce-account .woocommerce {
    font-family: "Montserrat", Arial, sans-serif;
}

.am-auth-page {
    color: #282828;
    font-size: 18px;
    font-weight: 400;
}

.am-auth-page *,
.am-auth-page *::before,
.am-auth-page *::after {
    box-sizing: border-box;
}

.am-auth-breadcrumbs {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 34px 0 8px;
    border-top: 1px solid #aeb2ac;
    color: #282828;
    font-size: 16px;
    line-height: 1.35;
}

.am-auth-breadcrumbs a:last-of-type,
.am-auth-breadcrumbs > span:last-child {
    color: #4e6248;
}

.am-auth-title,
.am-auth-login-column h1,
.am-auth-new-customer h2,
.am-auth-recovery-card h1,
.am-auth-code-card h1 {
    margin: 0;
    color: #3e5338;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
}

.am-auth-page--register .am-auth-title {
    margin: 6px 0 28px;
}

.am-auth-register-layout {
    display: grid;
    grid-template-columns: minmax(0, 723px) minmax(280px, 326px);
    align-items: start;
    gap: 28px;
    max-width: 1077px;
}

.am-auth-form {
    margin: 0;
}

.am-auth-fields-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.am-auth-control {
    position: relative;
    margin-bottom: 14px;
}

.am-auth-control input:not([type="checkbox"]):not([type="hidden"]),
.am-auth-control select {
    width: 100%;
    height: 64px;
    border: 1px solid #656565;
    border-radius: 4px;
    padding: 0 20px;
    outline: 0;
    background: #fff;
    color: #282828;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: normal;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.am-auth-control input::placeholder {
    color: #929292;
    opacity: 1;
}

.am-auth-control input:focus {
    border-color: #3e5338;
    box-shadow: 0 0 0 2px rgba(62, 83, 56, .1);
}

.am-auth-control.has-error input:not([type="checkbox"]):not([type="hidden"]),
.am-auth-control.has-error .am-country-select {
    border-color: #D32C2C;
}

.am-auth-field-error {
    display: block;
    margin-top: 6px;
    color: #D32C2C;
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0;
}

.am-auth-field-error--standalone {
    margin: -2px 0 2px;
}

.am-auth-control--icon input {
    padding-left: 50px !important;
}

.am-auth-input-icon {
    position: absolute;
    z-index: 2;
    left: 20px;
    top: 20px;
    width: 22px;
    height: 22px;
    color: #929292;
    pointer-events: none;
}

.am-auth-input-icon svg,
.am-auth-password-toggle svg,
.am-auth-benefits svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.am-auth-control--password input {
    padding-right: 56px !important;
}

.am-auth-password-toggle {
    position: absolute;
    z-index: 3;
    top: 18px;
    right: 18px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: #686868;
    cursor: pointer;
}

.am-auth-control.has-error .am-auth-password-toggle {
    color: #282828;
}

.am-auth-control--phone {
    min-height: 64px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    border: 1px solid #656565;
    border-radius: 4px;
    background: #fff;
}

.am-auth-control--phone > input:not([type="hidden"]) {
    height: 62px;
    border: 0 !important;
    box-shadow: none !important;
    padding-left: 10px !important;
}

.am-auth-control--phone .am-auth-field-error {
    position: absolute;
    left: 0;
    top: 100%;
}

.am-auth-control--phone.has-error {
    margin-bottom: 38px;
    border-color: #D32C2C;
}

.am-auth-control--phone .am-country-select {
    position: relative;
    min-width: 54px;
    height: 62px;
    border: 0;
    background: transparent;
}

.am-auth-control--phone .am-country-select__toggle {
    width: 54px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.am-auth-control--phone .am-country-select__flag {
    font-size: 22px;
    line-height: 1;
}

.am-auth-control--phone .am-country-select__toggle svg {
    width: 10px;
    fill: none;
    stroke: #777;
    stroke-width: 1.3;
}

.am-auth-control--phone .am-country-select__menu {
    position: absolute;
    z-index: 100;
    top: calc(100% + 4px);
    left: -1px;
    width: min(330px, 82vw);
    max-height: 290px;
    overflow-y: auto;
    border: 1px solid #d2d4cf;
    border-radius: 4px;
    padding: 6px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .13);
}

.am-auth-control--phone .am-country-select__option {
    width: 100%;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 3px;
    padding: 9px 10px;
    background: #fff;
    color: #282828;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.am-auth-control--phone .am-country-select__option:hover,
.am-auth-control--phone .am-country-select__option.is-selected {
    background: #eef1ec;
}

.am-auth-country-select__dial {
    color: #686868;
}

.am-auth-consents {
    display: grid;
    gap: 12px;
    margin: 8px 0 26px;
}

.am-auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #282828;
    font-size: 16px;
    line-height: 1.35;
    cursor: pointer;
}

.am-auth-checkbox input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.am-auth-checkbox__box {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #676767;
    border-radius: 2px;
    background: #fff;
}

.am-auth-checkbox input:checked + .am-auth-checkbox__box::after {
    content: "";
    width: 11px;
    height: 6px;
    border-left: 2px solid #3e5338;
    border-bottom: 2px solid #3e5338;
    transform: rotate(-45deg) translate(1px, -1px);
}

.am-auth-checkbox a {
    color: #4e6248;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.am-auth-checkbox .am-auth-terms-link {
    font-weight: 600;
}

.am-auth-checkbox.has-error .am-auth-checkbox__box {
    border-color: #D32C2C;
}

.am-auth-register-submit {
    display: grid;
    grid-template-columns: 354px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.am-auth-register-submit > .am-auth-button {
    width: 100%;
    height: 72px;
    min-height: 72px;
    max-height: 72px;
    align-self: start;
}

.am-auth-captcha {
    min-height: 69px;
    overflow: visible;
}

.am-auth-captcha.has-error [data-am-auth-hcaptcha],
.am-auth-captcha.has-error .am-hcaptcha-missing {
    outline: 1px solid #D32C2C;
    outline-offset: 2px;
    border-radius: 4px;
}

.am-auth-captcha .h-captcha {
    min-height: 69px;
}

.am-auth-button {
    min-height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3e5338;
    border-radius: 4px;
    padding: 16px 24px;
    background: #3e5338;
    color: #fff !important;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.am-auth-button:hover,
.am-auth-button:focus-visible {
    border-color: #31452d;
    background: #31452d;
}

.am-auth-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.am-auth-benefits {
    border-radius: 4px;
    padding: 22px 22px 20px;
    background: #f3f3f2;
}

.am-auth-benefits h2 {
    margin: 0 0 15px;
    color: #3e5338;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.am-auth-benefits ul {
    display: grid;
    gap: 13px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.am-auth-benefits li {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    gap: 9px;
    color: #282828;
    font-size: 16px;
    line-height: 1.3;
}

.am-auth-benefits svg {
    width: 22px;
    height: 22px;
    color: #3e5338;
}

.am-auth-notice {
    margin: 0 0 18px;
    border-left: 3px solid #3e5338;
    padding: 12px 14px;
    background: #f1f4ef;
    color: #282828;
    font-size: 15px;
}

.am-auth-notice--error {
    border-left-color: #f04444;
    background: #fff7f7;
    color: #d52828;
}

.am-auth-notice p:last-child {
    margin-bottom: 0;
}

/* Login */
.am-auth-page--login {
    padding-bottom: 18px;
}

.am-auth-login-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;
    padding-top: 10px;
}

.am-auth-login-column h1,
.am-auth-new-customer h2 {
    margin-bottom: 12px;
}

.am-auth-lead,
.am-auth-new-customer p {
    max-width: 590px;
    margin: 0 0 32px;
    color: #282828;
    font-size: 18px;
    line-height: 1.35;
}

.am-auth-login-form .am-auth-control {
    margin-bottom: 16px;
}

.am-auth-login-form .am-auth-control input {
    height: 72px;
    font-size: 18px;
}

.am-auth-login-form .am-auth-input-icon {
    top: 25px;
}

.am-auth-login-form .am-auth-password-toggle {
    top: 23px;
}

.am-auth-login-options {
    min-height: 44px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 16px;
}

.am-auth-login-options > a {
    color: #282828;
    font-size: 18px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.am-auth-login-options .am-auth-checkbox {
    font-size: 18px;
}

.am-auth-login-form .am-auth-button,
.am-auth-new-customer .am-auth-button {
    width: 100%;
}

.am-auth-new-customer {
    padding-left: 0;
}

.am-auth-new-customer p {
    margin-bottom: 33px;
}

/* Password recovery */
.am-auth-page--recovery {
    min-height: 540px;
}

.am-auth-recovery-card {
    width: min(100%, 640px);
    margin: 42px auto 0;
    text-align: center;
}

.am-auth-recovery-card > p,
.am-auth-code-card > p {
    margin: 14px auto 30px;
    color: #282828;
    font-size: 18px;
    line-height: 1.35;
}

.am-auth-reset-request {
    display: grid;
    gap: 16px;
}

.am-auth-reset-request .am-auth-control {
    margin: 0;
    text-align: left;
}

.am-auth-reset-request .am-auth-button {
    width: 100%;
}

.am-auth-back-link {
    color: #282828;
    font-size: 16px;
}

.am-auth-page--recovery.is-code-step {
    min-height: 525px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.am-auth-code-card {
    width: min(100%, 760px);
    margin-top: 130px;
    text-align: center;
}

.am-auth-code-card > p {
    margin-bottom: 31px;
}

.am-auth-code-inputs {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.am-auth-code-inputs input {
    width: 52px;
    height: 52px;
    border: 1px solid #6d8965;
    border-radius: 4px;
    outline: 0;
    background: #fff;
    color: #282828;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.am-auth-code-inputs input:focus {
    box-shadow: 0 0 0 2px rgba(109, 137, 101, .13);
}

.am-auth-code-inputs.has-error input {
    border-color: #D32C2C;
    color: #282828;
}

.am-auth-code-error {
    margin: 12px 0 0;
    color: #D32C2C;
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0;
}

.am-auth-code-help {
    margin: 30px 0 28px;
    color: #282828;
    font-size: 18px;
    line-height: 1.4;
}

.am-auth-code-help a {
    margin-left: 8px;
    color: #282828;
}

.am-auth-code-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.am-auth-code-actions a,
.am-auth-code-actions button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #282828;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.3;
    cursor: pointer;
}

/* Woo edit-account page reached after verification. */
.woocommerce-account .woocommerce-EditAccountForm {
    max-width: 780px;
}

.woocommerce-account .woocommerce-EditAccountForm input.input-text {
    min-height: 56px;
    border: 1px solid #656565;
    border-radius: 4px;
    padding: 12px 16px;
}

.woocommerce-account .woocommerce-EditAccountForm button.button {
    min-height: 52px;
    border-radius: 4px !important;
    padding: 14px 24px !important;
}

@media (max-width: 991px) {
    .am-auth-register-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
    }

    .am-auth-register-submit {
        grid-template-columns: 304px minmax(0, 1fr);
    }

    .am-auth-login-layout {
        gap: 24px;
    }
}

@media (max-width: 767px) {
    .woocommerce-account .am-content-layout {
        width: min(calc(100% - 32px), 1200px);
        padding-bottom: 42px;
    }

    .am-auth-page {
        font-size: 16px;
    }

    .am-auth-breadcrumbs {
        min-height: 0;
        justify-content: flex-start;
        gap: 7px;
        padding: 26px 0 7px;
        font-size: 13px;
    }

    .am-auth-title,
    .am-auth-login-column h1,
    .am-auth-new-customer h2,
    .am-auth-recovery-card h1,
    .am-auth-code-card h1 {
        font-size: 26px;
    }

    .am-auth-page--register .am-auth-title {
        margin: 10px 0 22px;
    }

    .am-auth-register-layout,
    .am-auth-login-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .am-auth-fields-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .am-auth-control input:not([type="checkbox"]):not([type="hidden"]),
    .am-auth-control select,
    .am-auth-login-form .am-auth-control input {
        height: 58px;
        padding-inline: 16px;
        font-size: 16px;
    }

    .am-auth-control--icon input {
        padding-left: 48px !important;
    }

    .am-auth-input-icon {
        left: 17px;
        top: 18px !important;
    }

    .am-auth-password-toggle {
        top: 16px !important;
        right: 15px;
    }

    .am-auth-control--phone,
    .am-auth-control--phone .am-country-select,
    .am-auth-control--phone .am-country-select__toggle,
    .am-auth-control--phone > input:not([type="hidden"]) {
        min-height: 58px;
        height: 58px;
    }

    .am-auth-checkbox,
    .am-auth-benefits li {
        font-size: 15px;
    }

    .am-auth-register-submit {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .am-auth-captcha {
        width: 100%;
        max-width: 304px;
    }

    .am-auth-button {
        min-height: 56px;
        font-size: 16px;
    }

    .am-auth-register-submit > .am-auth-button {
        height: 56px;
        min-height: 56px;
        max-height: 56px;
    }

    .am-auth-benefits {
        padding: 20px;
    }

    .am-auth-benefits h2 {
        font-size: 22px;
    }

    .am-auth-lead,
    .am-auth-new-customer p,
    .am-auth-recovery-card > p,
    .am-auth-code-card > p {
        font-size: 16px;
    }

    .am-auth-login-options {
        align-items: center;
    }

    .am-auth-login-options .am-auth-checkbox,
    .am-auth-login-options > a {
        font-size: 15px;
    }

    .am-auth-recovery-card {
        margin-top: 38px;
    }

    .am-auth-page--recovery.is-code-step {
        min-height: 500px;
    }

    .am-auth-code-card {
        margin-top: 86px;
    }

    .am-auth-code-inputs {
        gap: 8px;
    }

    .am-auth-code-inputs input {
        width: min(13vw, 46px);
        height: min(13vw, 46px);
        font-size: 20px;
    }

    .am-auth-code-help,
    .am-auth-code-actions a,
    .am-auth-code-actions button {
        font-size: 15px;
    }

    .am-auth-code-help a {
        display: block;
        margin: 5px 0 0;
    }
}

@media (max-width: 420px) {
    .woocommerce-account .am-content-layout {
        width: min(calc(100% - 24px), 1200px);
    }

    .am-auth-login-options {
        align-items: flex-start;
    }

    .am-auth-code-inputs {
        gap: 6px;
    }

    .am-auth-code-inputs input {
        width: 43px;
        height: 48px;
    }

    .am-auth-code-actions {
        gap: 14px;
    }
}

/* Verified password-change mode after the email code. */
.am-auth-verified-password {
    max-width: 720px;
    margin-bottom: 24px;
}

.am-auth-verified-password h2 {
    margin: 0 0 10px;
    color: #3e5338;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
}

.am-auth-verified-password > p {
    margin: 0 0 24px;
    font-size: 18px;
    line-height: 1.4;
}

.am-auth-new-password-form .am-auth-button {
    width: 100%;
}

.am-password-reset-mode .woocommerce-EditAccountForm {
    display: none !important;
}

@media (max-width: 767px) {
    .am-auth-verified-password h2 {
        font-size: 26px;
    }

    .am-auth-verified-password > p {
        font-size: 16px;
    }
}

/* ========================================================================== 
   Authentication layout/AJAX corrections
   ========================================================================== */
.woocommerce-account .am-content-layout--auth {
    width: min(calc(100% - 40px), 1200px);
    max-width: 1200px;
    padding-top: 0;
}

.woocommerce-account .am-content-layout--auth .am-entry,
.woocommerce-account .am-content-layout--auth .woocommerce,
.woocommerce-account .am-content-layout--auth .am-auth-page {
    width: 100%;
    max-width: none;
}

/* WooCommerce adds a boxed login form by default; the design has no outer box. */
.woocommerce-account .am-auth-login-form.woocommerce-form-login,
.woocommerce-account .woocommerce form.am-auth-login-form.login {
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.am-auth-login-layout,
.am-auth-register-layout {
    width: 100%;
    max-width: none;
}

.am-auth-login-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.am-auth-register-layout {
    grid-template-columns: minmax(0, 2.15fr) minmax(326px, 1fr);
}

.am-auth-form-status {
    display: none;
    margin: 0 0 14px;
    border-radius: 4px;
    padding: 11px 14px;
    font-size: 14px;
    line-height: 1.4;
}

.am-auth-form-status:not(:empty) {
    display: block;
}

.am-auth-form-status.is-error {
    border: 1px solid #D32C2C;
    background: #fff;
    color: #D32C2C;
    font-family: "Montserrat", Arial, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0;
}

.am-auth-form-status.is-success {
    border: 1px solid #b8c8b3;
    background: #f1f5ef;
    color: #3e5338;
}

.am-auth-form.is-loading {
    pointer-events: none;
}

.am-auth-form.is-loading > *:not(.am-auth-form-status) {
    opacity: .72;
}

.am-auth-form button[aria-busy="true"] {
    cursor: wait;
}

.am-auth-captcha .am-auth-field-error {
    margin-top: 6px;
}

.am-auth-code-form .am-auth-form-status {
    width: min(100%, 560px);
    margin-inline: auto;
}

@media (max-width: 991px) {
    .am-auth-register-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 767px) {
    .woocommerce-account .am-content-layout--auth {
        width: min(calc(100% - 40px), 1200px);
    }

    .am-auth-register-layout,
    .am-auth-login-layout {
        grid-template-columns: 1fr;
    }
}

/* Explicit auth hCaptcha widget (kept separate from consultation widgets). */
.am-auth-hcaptcha-widget {
    min-height: 78px;
}

.am-auth-hcaptcha-widget iframe {
    max-width: 100%;
}


/* Registration confirmation follows the approved SMS authenticator layout. */
.am-auth-page--register-verification {
    min-height: 430px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
}

.am-auth-page--register-verification .am-auth-code-card {
    /* Keep the existing content width; only the inner layout is adjusted. */
    width: min(100%, 760px);
    margin-top: 140px;
}

.am-auth-page--register-verification .am-auth-code-card > p {
    margin-top: 14px;
    margin-bottom: 26px;
}

.am-auth-page--register-verification .am-auth-registration-code-copy {
    max-width: 760px;
    margin-inline: auto;
    color: #282828;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

.am-auth-page--register-verification .am-auth-code-help--registration {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 20px;
    margin: 30px 0 28px;
}

.am-auth-page--register-verification .am-auth-code-help--registration a {
    margin-left: 0;
    color: #282828;
    font-weight: 400;
    text-decoration: none;
}

.am-auth-page--register-verification .am-auth-code-help--registration a:hover,
.am-auth-page--register-verification .am-auth-code-help--registration a:focus-visible {
    color: #3e5338;
}

.am-auth-page--register-verification .am-auth-code-inputs.has-error input {
    color: #D32C2C;
}

/* Every auth field validation state uses the same red design token. */
.am-auth-control.has-error input:not([type="checkbox"]):not([type="hidden"]),
.am-auth-control.has-error select,
.am-auth-control--phone.has-error,
.am-auth-checkbox.has-error .am-auth-checkbox__box,
.am-auth-code-inputs.has-error input {
    border-color: #D32C2C !important;
}

@media (max-width: 767px) {
    .am-auth-page--register-verification .am-auth-code-card {
        margin-top: 72px;
    }

    .am-auth-page--register-verification .am-auth-code-help--registration {
        gap: 8px 14px;
    }
}


/* Registration-code page keeps the current width but uses less empty space below. */
.woocommerce-account .am-content-layout--registration-verification {
    padding-bottom: 24px;
}

@media (max-width: 767px) {
    .am-auth-page--register-verification .am-auth-registration-code-copy {
        font-size: 16px;
        line-height: 1.45;
    }
    .woocommerce-account .am-content-layout--registration-verification {
        padding-bottom: 16px;
    }
}
