/* public/assets/css/customer-auth.css */

:root {
    --auth-primary: #175cd3;
    --auth-primary-dark: #1849a9;
    --auth-navy: #102a43;
    --auth-text: #243b53;
    --auth-muted: #627d98;
    --auth-border: #d9e2ec;
    --auth-background: #f4f7fb;
    --auth-surface: #ffffff;
    --auth-danger: #b42318;
    --auth-radius: 12px;
    --auth-shadow: 0 18px 48px rgba(16, 42, 67, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif; }
body { min-width: 320px; margin: 0; overflow-x: hidden; color: var(--auth-text); background: var(--auth-background); overflow-wrap: anywhere; }
button, input { font: inherit; }
a { color: inherit; }
.customer-skip-link { position: fixed; top: -80px; left: 16px; z-index: 10; padding: 10px 14px; color: #fff; background: var(--auth-navy); }
.customer-skip-link:focus { top: 12px; }
.customer-auth-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(10px, env(safe-area-inset-top)) 32px 10px; border-bottom: 1px solid rgba(217, 226, 236, 0.8); background: rgba(255, 255, 255, 0.9); }
.customer-auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--auth-navy); font-size: 1rem; font-weight: 800; text-decoration: none; }
.customer-auth-brand img { width: auto; height: 38px; object-fit: contain; }
.customer-auth-main { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 56px 20px; background: radial-gradient(circle at 10% 10%, rgba(23, 92, 211, 0.08), transparent 34%), var(--auth-background); }
.customer-auth-card { width: min(100%, 480px); padding: 44px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); background: var(--auth-surface); box-shadow: var(--auth-shadow); }
.customer-auth-card--message { text-align: center; }
.customer-auth-eyebrow { margin: 0 0 10px; color: var(--auth-primary); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; }
.customer-auth-card h1 { margin: 0; color: var(--auth-navy); font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.25; letter-spacing: -0.035em; }
.customer-auth-description { margin: 16px 0 28px; color: var(--auth-muted); font-size: 1rem; line-height: 1.7; }
.customer-auth-description--small { margin-bottom: 18px; font-size: 0.9375rem; }
.customer-auth-alert { margin-bottom: 20px; padding: 13px 15px; border-radius: 8px; color: var(--auth-danger); background: #fef3f2; font-size: 0.9rem; line-height: 1.5; }
.customer-social-actions { display: grid; gap: 12px; }
.customer-social-button { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 1px solid transparent; border-radius: 8px; font-size: 1rem; font-weight: 750; text-decoration: none; transition: transform 160ms ease, filter 160ms ease; }
.customer-social-button span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 0.78rem; font-weight: 900; }
.customer-social-button--kakao { color: #191919; background: #fee500; }
.customer-social-button--kakao span { background: rgba(25, 25, 25, 0.08); }
.customer-social-button--naver { color: #fff; background: #03c75a; }
.customer-social-button--naver span { background: rgba(255, 255, 255, 0.16); }
.customer-social-button--google { color: #1f1f1f; background: #fff; border-color: #747775; font-weight: 500; }
.customer-social-button--google span { color: #4285f4; font-size: 1.15rem; }
.customer-social-button--apple { color: #fff; background: #000; }
.customer-social-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.customer-social-button:hover { filter: brightness(0.98); transform: translateY(-1px); }
.customer-social-button:focus-visible, .customer-auth-back:focus-visible, .customer-primary-link:focus-visible, .customer-company-list button:focus-visible { outline: 3px solid rgba(23, 92, 211, 0.28); outline-offset: 3px; }
.customer-auth-notice { margin-top: 28px; padding: 18px; border: 1px solid var(--auth-border); border-radius: 8px; background: #f8fafc; }
.customer-auth-notice strong { color: var(--auth-navy); font-size: 0.9375rem; }
.customer-auth-notice p, .customer-auth-privacy { margin: 7px 0 0; color: var(--auth-muted); font-size: 0.875rem; line-height: 1.6; }
.customer-auth-back { margin-top: 24px; display: inline-block; color: var(--auth-muted); font-size: 0.9rem; text-underline-offset: 4px; }
.customer-invite-summary { margin: 0 0 24px; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border: 1px solid var(--auth-border); border-radius: 8px; background: #f8fafc; }
.customer-invite-summary div { min-width: 0; }
.customer-invite-summary dt { color: var(--auth-muted); font-size: 0.78rem; }
.customer-invite-summary dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--auth-navy); font-size: 0.92rem; font-weight: 700; }
.customer-auth-privacy { margin-top: 20px; }
.customer-auth-footer-actions { display: grid; justify-items: center; gap: 2px; }
.customer-primary-link { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; background: var(--auth-primary); font-weight: 750; text-decoration: none; }
.customer-social-link-status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.customer-social-link-status-actions form { margin: 0; display: flex; }
.customer-social-link-status-actions .customer-primary-link, .customer-social-link-status-actions .customer-primary-button { min-height: 52px; }
.customer-social-link-status-actions .customer-primary-button { padding: 0 18px; }
.customer-company-list { display: grid; gap: 10px; }
.customer-company-list form, .customer-company-list button { width: 100%; }
.customer-company-list button { padding: 16px; border: 1px solid var(--auth-border); border-radius: 8px; display: grid; gap: 5px; text-align: left; color: var(--auth-text); background: #fff; cursor: pointer; }
.customer-company-list button:hover { border-color: var(--auth-primary); }
.customer-company-list strong { color: var(--auth-navy); font-size: 1rem; }
.customer-company-list span { color: var(--auth-muted); font-size: 0.85rem; }
.customer-auth-help { width: 44px; height: 44px; flex: none; border: 1px solid var(--auth-border); border-radius: 10px; color: var(--auth-primary-dark); background: #fff; font-size: 1.05rem; font-weight: 850; cursor: pointer; }
.customer-company-code-form { display: grid; gap: 14px; }
.customer-company-code-form label { display: grid; gap: 8px; color: var(--auth-navy); font-size: 0.9rem; font-weight: 750; }
.customer-company-code-form input { width: 100%; min-height: 54px; padding: 0 16px; border: 1px solid var(--auth-border); border-radius: 8px; color: var(--auth-navy); background: #fff; font-size: 1.05rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.customer-company-code-form input:focus { outline: 3px solid rgba(23, 92, 211, 0.18); border-color: var(--auth-primary); }
.customer-primary-button { min-height: 52px; border: 0; border-radius: 8px; color: #fff; background: var(--auth-primary); font-weight: 800; cursor: pointer; }
.customer-general-login { margin-top: 22px; border-top: 1px solid var(--auth-border); }
.customer-general-login summary { min-height: 48px; display: flex; align-items: center; justify-content: center; color: var(--auth-muted); font-size: 0.84rem; cursor: pointer; }
.customer-general-login .customer-social-actions { margin-top: 8px; }
.customer-company-identity { min-width: 0; margin-bottom: 24px; padding: 18px; display: grid; grid-template-columns: minmax(74px, 112px) minmax(0, 1fr); align-items: center; gap: 18px; border: 1px solid #cfe0ff; border-radius: 10px; background: #f4f8ff; }
.customer-company-identity img, .customer-company-logo-fallback { width: 100%; height: 72px; display: grid; place-items: center; border-radius: 8px; object-fit: contain; color: var(--auth-primary-dark); background: #e5efff; font-size: 0.82rem; font-weight: 850; }
.customer-company-identity div { min-width: 0; display: grid; gap: 6px; }
.customer-company-identity strong { min-width: 0; overflow: hidden; color: var(--auth-navy); font-size: 1.08rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.customer-company-identity small { color: var(--auth-muted); font-size: 0.82rem; }
.customer-powered-by { margin: 18px 0 0; color: var(--auth-muted); font-size: 0.78rem; text-align: center; }
.customer-powered-by strong { color: var(--auth-primary-dark); letter-spacing: 0.03em; }
.cmd-error-summary { margin: 0 0 20px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #fecdca; border-radius: 8px; color: var(--auth-danger); background: #fef3f2; font-size: 0.86rem; line-height: 1.5; }
.cmd-error-summary button { min-height: 44px; flex: none; border: 1px solid #fda29b; border-radius: 7px; color: var(--auth-danger); background: #fff; cursor: pointer; }
.cmd-error-dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0; border: 0; border-radius: 12px; background: transparent; }
.cmd-error-dialog::backdrop { background: rgba(16, 42, 67, 0.44); }
.cmd-error-dialog__panel { padding: 26px; overflow-y: auto; color: var(--auth-text); background: #fff; }
.cmd-error-dialog h2 { margin: 0 0 18px; color: var(--auth-navy); font-size: 1.25rem; }
.cmd-error-dialog dl { margin: 0; display: grid; gap: 10px; }
.cmd-error-dialog dl div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
.cmd-error-dialog dt { color: var(--auth-muted); font-size: 0.82rem; }
.cmd-error-dialog dd { margin: 0; overflow-wrap: anywhere; color: var(--auth-navy); font-size: 0.88rem; font-weight: 700; }
.cmd-error-dialog__actions { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cmd-error-dialog__actions button, .cmd-error-dialog__actions a { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--auth-border); border-radius: 8px; color: var(--auth-navy); background: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.cmd-error-dialog__status { min-height: 20px; margin: 10px 0 0; color: var(--auth-primary-dark); font-size: 0.82rem; }
@media (max-width: 560px) {
    .customer-auth-header { height: 64px; padding: 0 20px; }
    .customer-auth-brand img { height: 32px; }
    .customer-auth-main { min-height: calc(100vh - 64px); padding: 28px 14px; align-items: start; }
    .customer-auth-card { padding: 30px 22px; }
    .customer-invite-summary { grid-template-columns: 1fr; }
    .customer-company-identity { grid-template-columns: 70px minmax(0, 1fr); gap: 13px; padding: 14px; }
    .customer-company-identity img, .customer-company-logo-fallback { height: 58px; }
    .cmd-error-summary { align-items: stretch; flex-direction: column; }
    .cmd-error-dialog__panel { padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
    .cmd-error-dialog dl div { grid-template-columns: 1fr; gap: 3px; }
    .cmd-error-dialog__actions { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .customer-social-button { transition: none; } }

/* Public read-only legal documents reuse the authentication layout and tokens. */
.customer-auth-card.legal-document-card { width: min(100%, 960px); min-width: 0; overflow-wrap: anywhere; }
.legal-document-body { margin-top: 28px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.legal-consent-card { overflow-wrap: anywhere; }
.legal-consent-document { margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--auth-border); }
.legal-consent-document h2 { font-size: 1.1rem; line-height: 1.6; }
.legal-consent-document summary { min-height: 44px; padding: 10px 0; color: var(--auth-primary); cursor: pointer; }
.legal-consent-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 0; cursor: pointer; line-height: 1.6; }
.legal-consent-check input { flex: none; width: 22px; height: 22px; margin: 2px 0; accent-color: var(--auth-primary); }
.legal-consent-card .customer-primary-button { width: 100%; padding: 12px 16px; }
.legal-consent-logout { margin-top: 20px; text-align: center; }
.legal-status-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.legal-status-controls a, .legal-status-controls button { display: inline-block; min-height: 44px; padding: 10px; }
.legal-status-controls form, .legal-status-controls input { max-width: 100%; min-width: 0; }
.customer-auth-main > nav { width: min(100%, 960px); min-width: 0; overflow-wrap: anywhere; text-align: center; }
.customer-auth-main > nav a { display: inline-block; padding: 10px 4px; min-height: 44px; }
.legal-document-card > details > summary, .legal-document-card section > details > summary { min-height: 44px; padding: 10px 0; cursor: pointer; overflow-wrap: anywhere; }
.legal-consent-logout button { min-height: 44px; padding: 10px 18px; border: 0; background: transparent; cursor: pointer; }

/* Consent-only cards and native dialogs leave other authentication screens unchanged. */
.customer-auth-main:has(> .legal-consent-card) { align-content: start; align-items: start; gap: 16px; padding: 28px 16px; }
.customer-auth-card.legal-consent-card { width: min(100%, 680px); padding: 28px; }
.legal-consent-card h1 { font-size: 1.6rem; }
.legal-consent-card header .customer-auth-description { margin: 8px 0 22px; }
.legal-consent-list { border: 1px solid var(--auth-border); border-radius: var(--auth-radius); overflow: hidden; }
.legal-consent-card .legal-consent-document { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; border-top: 0; }
.legal-consent-card .legal-consent-document + .legal-consent-document { border-top: 1px solid var(--auth-border); }
.legal-consent-card .legal-consent-document h2 { margin: 0; font-size: 0.98rem; line-height: 1.6; }
.legal-consent-card .legal-consent-check { align-items: center; gap: 10px; padding: 0; font-size: 0.98rem; font-weight: 600; }
.legal-consent-card .legal-consent-check input { margin: 0; }
.legal-consent-label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 44px; }
.legal-consent-state { padding: 3px 8px; border-radius: 6px; color: var(--auth-primary-dark); background: #eff6ff; font-size: 0.8rem; font-weight: 600; }
.legal-consent-view, .legal-consent-dialog-close { min-height: 44px; padding: 9px 12px; border: 1px solid var(--auth-border); border-radius: 8px; color: var(--auth-primary); background: var(--auth-surface); font-weight: 600; white-space: nowrap; cursor: pointer; }
.legal-consent-view:hover, .legal-consent-dialog-close:hover { border-color: var(--auth-primary); background: #eff6ff; }
.legal-consent-view:active, .legal-consent-dialog-close:active { background: #dbeafe; }
.legal-consent-card button:focus-visible, .legal-consent-card summary:focus-visible, .legal-consent-dialog-scroll:focus-visible { outline: 3px solid rgba(23, 92, 211, 0.35); outline-offset: 2px; }
.legal-consent-management { margin-top: 14px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); }
.legal-consent-card .legal-consent-management > summary { min-height: 54px; padding: 14px 16px; color: var(--auth-primary); font-weight: 600; cursor: pointer; }
.legal-consent-management > section { padding: 0 16px 16px; }
.legal-consent-management h2 { font-size: 1rem; }
.legal-consent-card .legal-consent-continue { margin-top: 20px; min-height: 52px; }
.legal-consent-card .legal-consent-logout { margin-top: 8px; }
.legal-consent-card .legal-consent-logout button { margin-top: 0; }
.legal-consent-card .legal-consent-version { margin: 6px 0 0; color: var(--auth-muted); font-size: 0.875rem; line-height: 1.6; }
.legal-consent-dialog { width: min(760px, calc(100% - 32px)); max-width: none; max-height: min(780px, calc(100dvh - 40px)); padding: 0; border: 1px solid var(--auth-border); border-radius: 16px; color: var(--auth-text); background: var(--auth-surface); box-shadow: var(--auth-shadow); overflow: hidden; }
.legal-consent-dialog[open] { display: flex; flex-direction: column; }
.legal-consent-dialog::backdrop { background: rgba(16, 42, 67, 0.5); }
.legal-consent-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--auth-border); flex: none; }
.legal-consent-dialog-header > div { min-width: 0; }
.legal-consent-dialog-header h2 { margin: 0; color: var(--auth-navy); font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
.legal-consent-dialog-close { flex: none; }
.legal-consent-dialog-scroll { min-height: 0; padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.legal-consent-card .legal-consent-dialog .legal-document-body { margin: 0; }
html:has(.legal-consent-dialog[open]) { overflow: hidden; }
@media (max-width: 560px) {
    .customer-auth-main:has(> .legal-consent-card) { padding: 16px 12px; }
    .customer-auth-card.legal-consent-card { padding: 20px 16px; }
    .legal-consent-card h1 { font-size: 1.4rem; }
    .legal-consent-card .legal-consent-document { padding: 12px; gap: 10px; }
    .legal-consent-view { padding: 9px; font-size: 0.875rem; }
    .legal-consent-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 12px; }
    .legal-consent-dialog-header { padding: 16px; gap: 10px; }
    .legal-consent-dialog-scroll { padding: 16px; }
}
