.chm-account-auth-page .woocommerce-page-shell,
.chm-account-auth-page .woocommerce-page-shell.section,
.chm-account-auth-page article.section {
    width: 100%;
    max-width: none;
    padding: 0 16px 32px;
}

.chm-account-auth-page .page-heading { display: none; }
.chm-account-auth-page .entry-content,
.chm-account-auth-page .woocommerce-content { width: 100%; max-width: none; }
.chm-account-auth-page .woocommerce-notices-wrapper { width: min(448px,100%); margin: 24px auto 0; }

.chm-auth-shell {
    display: flex;
    min-height: calc(100vh - 100px);
    min-height: calc(100dvh - 100px);
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.chm-auth-stack { display: grid; width: 100%; max-width: 448px; gap: 24px; }
.chm-auth-card {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 24px;
    padding: 24px 0;
    overflow: hidden;
    border-radius: 26px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 0 0 1px rgba(23,23,23,.05), 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

.chm-auth-header { display: grid; gap: 6px; padding: 0 24px; text-align: center; }
.chm-auth-header h1 { margin: 0; font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 500; }
.chm-auth-header p { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.chm-auth-body { padding: 0 24px; }
.chm-auth-intro { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid #fde68a; border-radius: 8px; color: #78350f; background: #fffbeb; font-size: 12px; line-height: 16px; }
.chm-auth-intro svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chm-auth-intro p { margin: 0; }
.chm-auth-controls { display: grid; gap: 28px; margin-top: 16px; }

.chm-auth-alert,
.chm-auth-status:not(:empty) { display: block; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 20px; }
.chm-auth-alert.is-error,
.chm-auth-status.is-error { border: 1px solid #fecaca; color: #991b1b; background: #fef2f2; }
.chm-auth-status.is-success { border: 1px solid #bbf7d0; color: #166534; background: #f0fdf4; }

.chm-auth-socials { display: grid; gap: 12px; }
.chm-auth-social {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    transition: background-color 180ms ease, border-color 180ms ease;
}
.chm-auth-social svg { width: 18px; height: 18px; flex: 0 0 18px; }
.chm-auth-social.is-apple { border-color: #000; color: #fff; background: #000; }
.chm-auth-social.is-apple:not(:disabled):hover,
.chm-auth-social.is-apple:not(:disabled):focus-visible { background: #262626; }
.chm-auth-social.is-google { color: var(--muted); background: var(--paper); }
.chm-auth-social.is-google:not(:disabled):hover,
.chm-auth-social.is-google:not(:disabled):focus-visible { color: var(--ink); background: var(--wash); }

.chm-auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; line-height: 16px; }
.chm-auth-divider::before,
.chm-auth-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.chm-auth-method { display: grid; gap: 12px; }

.chm-auth-tabs { display: grid; min-height: 36px; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 3px; border-radius: 999px; background: var(--wash); }
.chm-auth-tabs button { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; gap: 7px; padding: 5px 12px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 14px; line-height: 20px; font-weight: 500; }
.chm-auth-tabs button svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chm-auth-tabs button[aria-selected="true"] { color: var(--ink); background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.chm-auth-form { display: grid; gap: 28px; }
.chm-auth-form[hidden] { display: none; }
.chm-auth-status:empty { display: none; }
.chm-auth-field-group { display: grid; gap: 12px; }
.chm-auth-form label { color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; }
.chm-auth-form input[type="email"],
.chm-auth-form input[type="tel"] {
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: var(--ink);
    background: var(--wash);
    font-size: 16px;
    line-height: 22px;
}
.chm-auth-form input:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb,var(--focus) 24%,transparent); outline-offset: 1px; }
.chm-auth-field-group > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.chm-auth-submit { min-height: 36px; padding: 7px 12px; border: 1px solid #171717; border-radius: 999px; color: #fff; background: #171717; font-size: 14px; line-height: 20px; font-weight: 500; }
.chm-auth-submit:hover:not(:disabled), .chm-auth-submit:focus-visible:not(:disabled) { background: #333; }
.chm-auth-submit:disabled { border-color: #d4d4d4; color: #8a8a8a; background: #ececec; cursor: not-allowed; }

.chm-auth-phone-field { display: grid; grid-template-columns: auto minmax(0,1fr); }
.chm-auth-phone-field input[type="tel"] { border-radius: 0 18px 18px 0; }
.chm-auth-country-trigger { display: inline-flex; min-width: 94px; min-height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-right: 0; border-radius: 18px 0 0 18px; color: var(--ink); background: var(--paper); font-size: 14px; }
.chm-auth-country-trigger:hover, .chm-auth-country-trigger:focus-visible { background: var(--wash); }
.chm-auth-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.chm-auth-legal { margin: 0; padding: 0 24px; color: var(--muted); text-align: center; font-size: 12px; line-height: 18px; }
.chm-auth-legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.chm-auth-country-dialog { width: min(420px,calc(100vw - 32px)); max-height: min(680px,calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.chm-auth-country-dialog::backdrop { background: rgba(0,0,0,.46); }
.chm-auth-country-head { display: flex; min-height: 56px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chm-auth-country-head h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.chm-auth-country-head button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: var(--wash); }
.chm-auth-country-head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.chm-auth-country-dialog > input { width: calc(100% - 32px); min-height: 42px; margin: 16px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); font-size: 16px; }
.chm-auth-country-list { max-height: min(520px,calc(100dvh - 148px)); overflow-y: auto; padding: 0 8px 12px; }
.chm-auth-country-list button { display: grid; width: 100%; min-height: 48px; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; text-align: left; font-size: 14px; }
.chm-auth-country-list button:hover, .chm-auth-country-list button:focus-visible, .chm-auth-country-list button[aria-selected="true"] { background: var(--wash); }
.chm-auth-country-list small { color: var(--muted); font-size: 13px; }

.chm-auth-modal {
    width: min(448px,calc(100vw - 32px));
    max-width: 448px;
    max-height: 85vh;
    max-height: 85dvh;
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 26px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 20px 48px rgba(0,0,0,.22), 0 0 0 1px rgba(23,23,23,.05);
}
.chm-auth-modal::backdrop { background: rgba(0,0,0,.46); }
.chm-auth-modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--ink); background: var(--wash); }
.chm-auth-modal-close:hover, .chm-auth-modal-close:focus-visible { background: #e7e7e8; }
.chm-auth-modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chm-auth-modal .chm-auth-shell { min-height: 0; padding: 0; }
.chm-auth-modal .chm-auth-stack { max-width: none; gap: 24px; }
.chm-auth-modal .chm-auth-card { gap: 24px; padding: 0; overflow: visible; border-radius: 0; box-shadow: none; }
.chm-auth-modal .chm-auth-header, .chm-auth-modal .chm-auth-body, .chm-auth-modal .chm-auth-legal { padding-right: 0; padding-left: 0; }

body.chm-dark-mode .chm-auth-social.is-apple { border-color: #f5f5f5; color: #171717; background: #f5f5f5; }
body.chm-dark-mode .chm-auth-submit { border-color: #f5f5f5; color: #171717; background: #f5f5f5; }
body.chm-dark-mode .chm-auth-intro { border-color: #78350f; color: #fde68a; background: #451a03; }

@media (max-width: 520px) {
    .chm-auth-modal { width: calc(100vw - 6px); max-width: calc(100vw - 6px); padding: 16px; }
    .chm-auth-modal-close { top: 10px; right: 10px; }
    .chm-account-auth-page .woocommerce-page-shell,
    .chm-account-auth-page .woocommerce-page-shell.section,
    .chm-account-auth-page article.section { padding-right: 16px; padding-left: 16px; }
    .chm-auth-shell { min-height: auto; align-items: flex-start; padding: 25px 0 60px; }
    .chm-auth-stack { min-width: 0; }
    .chm-auth-header { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 340px) {
    .chm-account-auth-page .woocommerce-page-shell,
    .chm-account-auth-page .woocommerce-page-shell.section,
    .chm-account-auth-page article.section { padding-right: 10px; padding-left: 10px; }
    .chm-auth-body { padding: 20px; }
    .chm-auth-header { padding-right: 20px; padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .chm-auth-social, .chm-auth-submit { transition: none; }
}
