/* ==========================================================================
   Login Modal — bottom-sheet
   ========================================================================== */

#tsc-login-modal { z-index: 100002; }

/* View toggle tabs */
.tsc-login-tabs {
    display: flex;
    background: #f5f5f7;
    border-radius: 999px;
    padding: 4px;
    margin: 0 0 20px;
    gap: 4px;
}
.tsc-login-tab {
    flex: 1;
    background: transparent !important;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #8a8b91 !important;
    cursor: pointer;
    transition: all 0.2s;
}
.tsc-login-tab.is-active {
    background: #fff !important;
    color: #161823 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tsc-login-social {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tsc-login-social > * + * {
    margin-top: 8px;
}
/* Centre any social-login button rendered inside the modal (Nextend, etc.). */
.tsc-login-social > * {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* On mobile the cart's fixed bottombar overlaps the bottom of the modal —
   add enough padding-bottom so the submit button and links clear it. */
@media (max-width: 767px) {
    #tsc-login-modal .tsc-modal__body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
}

.tsc-login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #b0b1b7;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0;
}
.tsc-login-divider::before,
.tsc-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ececef;
}

.tsc-login-field {
    margin-bottom: 12px;
}
.tsc-login-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 6px;
}
.tsc-login-field__input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ececef;
    border-radius: 8px;
    font-size: 14px;
    color: #161823;
    background: #f5f5f7;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, background 0.15s;
}
.tsc-login-field__input:focus {
    outline: none;
    border-color: #161823;
    background: #fff;
}
.tsc-login-field__hint {
    font-size: 12px;
    color: #8a8b91;
    margin-top: 4px;
}
/* The red star after the label of a box that must be filled in. */
.tsc-login-req {
    color: #dc2626;
    font-weight: 700;
}
/* A wrong or empty box: red message under it, red border and a light red fill. */
.tsc-login-field__error {
    font-size: 12px;
    font-weight: 500;
    color: #dc2626;
    margin-top: 4px;
    display: none;
}
.tsc-login-field.has-error .tsc-login-field__input,
.tsc-login-field.has-error .tsc-login-field__input:focus,
.tsc-login-field.has-error .tsc-login-dial {
    border-color: #dc2626;
    background: #fef2f2;
}
.tsc-login-field.has-error .tsc-login-field__error {
    display: block;
}

.tsc-login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #161823;
    margin: 8px 0 16px;
    cursor: pointer;
}
.tsc-login-remember input {
    width: 16px;
    height: 16px;
    accent-color: #161823;
    margin: 0;
}

.tsc-login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.tsc-login-error.is-visible {
    display: block;
}

.tsc-login-success {
    background: #f0f0f0;
    color: #161823;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.tsc-login-success.is-visible {
    display: block;
}

.tsc-login-submit {
    width: 100%;
    padding: 14px;
    background: var(--global-palette-btn-bg, #161823) !important;
    color: var(--global-palette-btn, #fff) !important;
    border: 0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.tsc-login-submit:disabled {
    background: #f5f5f7 !important;
    color: #b0b1b7 !important;
    cursor: not-allowed;
}

.tsc-login-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #8a8b91;
}
.tsc-login-switch button {
    background: none;
    border: 0;
    padding: 0;
    color: #161823;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}
.tsc-login-form {
    padding-left: 20%;
    padding-right: 20%;
}

/* ==========================================================================
   My Account card, names row, tick box (0.31.0; used with "Phone Sign-up and
   Log-in" on or off since 0.34.0). The phone box, "Register with" and the
   code screens below appear only while that switch is on.
   ========================================================================== */

/* The card on the logged-out My Account page (templates/woocommerce/myaccount/form-login.php). */
/* Room under the menu bar, and side margins on a phone so the card's border does not touch the screen edge. */
.tsc-auth-page {
    display: flex;
    justify-content: center;
    padding: 16px 12px 40px;
}
@media (min-width: 768px) {
    .tsc-auth-page { padding: 40px 0 56px; }
}
.tsc-auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 16px;
    padding: 24px 20px;
    box-sizing: border-box;
    color: #161823;
}
@media (min-width: 768px) {
    .tsc-auth-card { padding: 32px 32px 28px; }
}
/* The sheet's narrow middle column is not needed inside the card. */
.tsc-auth-card .tsc-login-form {
    padding-left: 0;
    padding-right: 0;
}
.tsc-auth-noscript {
    margin: 0;
    font-size: 14px;
    text-align: center;
}

/* First name | Last name side by side. */
.tsc-login-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
/* The sheet's form is narrow on phones, so stack the names there. */
@media (max-width: 480px) {
    #tsc-login-modal .tsc-login-row { grid-template-columns: 1fr; gap: 0; }
}

/* "Register with": WhatsApp number | Email. The picked one has the dark border. */
.tsc-login-method {
    margin: 0 0 14px;
}
.tsc-login-method__label {
    font-size: 13px;
    font-weight: 600;
    color: #161823;
    margin-bottom: 6px;
}
.tsc-login-method__options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.tsc-login-method__option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 8px;
    background: #fff !important;
    color: #8a8b91 !important;
    border: 1px solid #dcdce0 !important;
    border-radius: 8px;
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.tsc-login-method__option svg { flex: 0 0 auto; }
.tsc-login-method__option.is-active {
    color: #161823 !important;
    border-color: #161823 !important;
    box-shadow: inset 0 0 0 1px #161823;
}
.tsc-login-method__option.is-active[data-method="phone"] svg { color: #25d366; }
.tsc-login-method__option:focus-visible {
    outline: 2px solid #161823;
    outline-offset: 2px;
}

/* Phone box: country code list + number side by side. */
.tsc-login-phone {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.tsc-login-phone .tsc-login-field__input {
    flex: 1 1 auto;
    min-width: 0;
}
/* What is seen is "+60" and an arrow; the real list lies invisible on top of it. */
.tsc-login-dial {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px 0 14px;
    border: 1px solid #ececef;
    border-radius: 8px;
    background: #f5f5f7;
    color: #161823;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}
.tsc-login-dial svg { color: #8a8b91; flex: 0 0 auto; }
.tsc-login-dial:focus-within {
    border-color: #161823;
    background: #fff;
}
.tsc-login-dial__select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    cursor: pointer;
    font-size: 16px; /* 16px or more: iPhones do not zoom in when the list opens. */
    -webkit-appearance: none;
    appearance: none;
}

/* "Send me updates..." tick box — starts ticked (0.32.0). */
.tsc-login-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #161823;
    margin: 4px 0 16px;
    cursor: pointer;
}
.tsc-login-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #161823;
}

.tsc-login-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: #8a8b91;
    text-align: center;
}

/* Title above the code screens: "Check your WhatsApp". */
.tsc-login-head {
    text-align: center;
    margin: 0 0 16px;
}
.tsc-login-head__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #161823;
}
.tsc-login-head__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #8a8b91;
}
.tsc-login-head__text strong {
    color: #161823;
    white-space: nowrap;
}

/* The 6-digit code box: big, spaced-out digits. */
.tsc-login-field__input.tsc-login-code {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
    padding: 12px 8px 12px calc(8px + 0.4em);
    font-variant-numeric: tabular-nums;
}

/* "Log in with a WhatsApp code" — second button under "Log in". */
.tsc-login-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 13px 14px;
    background: #fff !important;
    color: #161823 !important;
    border: 1px solid #161823;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.tsc-login-alt:hover,
.tsc-login-alt:focus-visible { background: #f5f5f7 !important; }
.tsc-login-alt svg { color: #25d366; flex: 0 0 auto; }

.tsc-login-forgot {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
}
.tsc-login-forgot a {
    color: #161823;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* "Send a new code in 42s" */
.tsc-login-resend {
    text-align: center;
    margin-top: 14px;
}
.tsc-login-resend button {
    background: none !important;
    border: 0;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #161823 !important;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tsc-login-resend button:disabled {
    color: #8a8b91 !important;
    cursor: default;
    text-decoration: none;
}

/* The sheet's form column keeps its 20% sides; on the card the alt button and links line up with the form. */
#tsc-login-modal .tsc-login-alt,
#tsc-login-modal .tsc-login-forgot,
#tsc-login-modal .tsc-login-resend {
    margin-left: 20%;
    margin-right: 20%;
    width: auto;
}

/* The alt button is a <button>, and a button with "width: auto" is only as wide as its
   words, never as wide as the space it sits in. "Register" came out as a small pill on
   the left of the sheet (0.35.0). Its width is spelled out here so it fills the form
   column, exactly under the "Log in" button: the middle 60% on wide screens (0.35.1). */
#tsc-login-modal .tsc-login-alt {
    box-sizing: border-box;
    width: 60%;
}

/* The sheet is a .tsc-modal, and assets/css/canvas.css takes the underline off every link
   inside one. "Forgot your password?" is a plain text link in the same ink as the text
   around it, so without its underline nothing shows it can be tapped. It keeps the
   underline in the sheet too, the same as on the My Account card (0.34.0). */
#tsc-login-modal .tsc-login-forgot a {
    text-decoration: underline !important;
}

/* On phones the sheet is narrow already, so the form and the links under it use its full
   width instead of the middle 60% (0.35.0). On a 390px phone the boxes grow from 198px to
   330px wide, the same as on the My Account card. Wider screens keep the 20% sides. */
@media (max-width: 767px) {
    #tsc-login-modal .tsc-login-form {
        padding-left: 0;
        padding-right: 0;
    }
    #tsc-login-modal .tsc-login-alt,
    #tsc-login-modal .tsc-login-forgot,
    #tsc-login-modal .tsc-login-resend {
        margin-left: 0;
        margin-right: 0;
    }
    /* ...and the alt button fills the sheet too, like the "Log in" button (0.35.1). */
    #tsc-login-modal .tsc-login-alt {
        width: 100%;
    }
}

/* "Lost your password?" pages (0.35.0). Their forms reuse the card, field and button
   classes above, so they look like the log-in card on every theme. This is the one line
   of words on the "email sent" screen
   (templates/woocommerce/myaccount/lost-password-confirmation.php). */
.tsc-auth-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #161823;
    text-align: center;
}

/* Green WooCommerce notices are hidden on account pages (see "Hide native WooCommerce
   success / info notices" in checkout.css) because the plugin shows a toast after its own
   actions. A password reset has no toast: the page simply reloads. So for a visitor who is
   not logged in the green notice stays, drawn as a calm strip the same width as the card:
   "Password reset email has been sent." and "Your password has been reset successfully."
   (0.35.0). A logged-in customer is not affected. */
body.woocommerce-account:not(.logged-in) .woocommerce-message {
    display: block !important;
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: 440px;
    margin: 16px auto 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: #ecfdf3;
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}
/* WooCommerce's tick icon is placed for WooCommerce's own padding, so it is switched off. */
body.woocommerce-account:not(.logged-in) .woocommerce-message::before {
    display: none;
}
/* On a wide screen the card starts 40px lower, so the strip gets more room above it too. */
@media (min-width: 768px) {
    body.woocommerce-account:not(.logged-in) .woocommerce-message {
        margin-top: 32px;
    }
}
