/* Shared presentation only. Forms, permissions and credential handling stay in their owners. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ink: var(--text);
  --card: var(--surface);
  --soft: var(--page);
  --accent: var(--purple);
  --accent-text: color-mix(in srgb, var(--purple) 25%, var(--text));
  --accent-soft: color-mix(in srgb, var(--purple) 9%, var(--surface));
  --interface-danger: color-mix(in srgb, #c83d50 62%, var(--text));
  --interface-shadow: 0 20px 70px rgb(15 23 42 / .16), 0 2px 8px rgb(15 23 42 / .04);
}
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
:is(h1, h2, h3) { text-wrap: balance; }
:is(button, a, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
}
:is(body, .customer-page) .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: -.01em;
  transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
:is(body, .customer-page) .button.primary { color: var(--site-on-accent, #fff); background: var(--purple); box-shadow: none; }
:is(body, .customer-page) .button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--purple) 90%, #000); box-shadow: 0 4px 16px color-mix(in srgb, var(--purple) 17%, transparent); }
:is(body, .customer-page) .button.secondary { color: var(--text); background: var(--surface); border-color: var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / .035); }
:is(body, .customer-page) .button.secondary:hover:not(:disabled) { border-color: color-mix(in srgb, var(--line) 60%, var(--muted)); background: var(--page); }
:is(body, .customer-page) .button.danger { background: #b83245; color: #fff; }
:is(body, .customer-page) .button.danger:hover:not(:disabled) { background: #9f2638; }
:is(body, .customer-page) .button.compact { min-height: 36px; padding: 7px 15px; font-size: 12px; }
:is(body, .customer-page) .button:active:not(:disabled) { transform: scale(.985); }
:is(body, .customer-page) .button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.text-button { font-size: 13px; color: var(--accent-text); }
.text-button.danger-text { color: var(--interface-danger); }
:is(body, .customer-page) .icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 36px; padding: 0;
  border: 1px solid transparent; border-radius: 50%;
  color: var(--muted); background: var(--page); font-size: 24px; line-height: 1;
  transition: color .18s, background-color .18s;
}
:is(body, .customer-page) .icon-button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, var(--surface)); }
:is(body, .customer-page) .field { display: grid; align-content: start; gap: 9px; min-width: 0; color: var(--text); font-size: 13px; font-weight: 550; line-height: 1.5; }
:is(body, .customer-page) :is(.field, .search-box) input:not([type=checkbox]):not([type=radio]):not([type=color]),
:is(body, .customer-page) .field :is(select, textarea) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 46px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px;
  color: var(--text); background: var(--surface); font-size: 14px; font-weight: 400; line-height: 1.5;
  box-shadow: 0 1px 2px rgb(0 0 0 / .015);
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
:is(body, .customer-page) .field textarea { min-height: 112px; resize: vertical; }
:is(body, .customer-page) .field :is(input, select, textarea):focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
:is(body, .customer-page) .field :is(input, select, textarea):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
:is(body, .customer-page) .field :is(input, select, textarea):disabled { cursor: not-allowed; background: var(--page); color: var(--muted); }
:is(input, textarea)::placeholder { color: var(--muted); opacity: .8; }
:is(body, .customer-page) :is(.field-help, .form-help) { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; overflow-wrap: anywhere; }
:is(input[type=checkbox], input[type=radio]) { accent-color: var(--accent); }
:is(body, .customer-page) .field .password-field input { padding-right: 78px; }
.password-toggle { border-radius: 999px; color: var(--accent-text); font-size: 12px; }
.password-toggle:hover { background: var(--accent-soft); }

/* Native dialog keeps focus containment and the browser top layer. */
:is(body, .customer-page) dialog.modal {
  box-sizing: border-box; width: min(640px, calc(100vw - 40px)); max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 48px); margin: auto; padding: 30px;
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 26px;
  background: var(--surface); color: var(--text); box-shadow: var(--interface-shadow);
}
dialog.modal::backdrop { background: rgb(12 18 30 / .38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
:is(body, .customer-page) .modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
:is(body, .customer-page) .modal-heading h2 { margin: 0; color: var(--text); font-size: 26px; line-height: 1.3; letter-spacing: -.035em; font-weight: 600; }
:is(body, .customer-page) :is(.modal-description, .customer-auth-heading p) { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.75; }
:is(body, .customer-page) .modal-fields { display: grid; gap: 20px; padding: 0; }
:is(body, .customer-page) .modal-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
:is(body, .customer-page) .modal-footer .button { min-width: 96px; }
:is(body, .customer-page) :is(.account-tabs, .customer-auth-switch) { gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--page); }
:is(body, .customer-page) :is(.account-tabs, .customer-auth-switch) button { border: 0; border-radius: 11px; padding: 9px 13px; color: var(--muted); background: transparent; font-size: 13px; line-height: 1.5; }
:is(body, .customer-page) .account-tabs button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 5px rgb(0 0 0 / .07); }
:is(body, .customer-page) :is(.record-summary, .secret-record, .session-notice) { padding: 16px 18px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--page); color: var(--muted); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
:is(body, .customer-page) :is(.secret-value, .code-value) { max-width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--page); color: var(--text); font-size: 13px; line-height: 1.8; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Inline notices stay next to their action; status text remains in the DOM. */
:is(body, .customer-page) .global-notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 17px;
  color: var(--accent-text); background: var(--accent-soft); font-size: 13px; line-height: 1.7;
  box-shadow: 0 2px 8px rgb(0 0 0 / .025); overflow-wrap: anywhere;
}
.global-notice::before { content: "i"; display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: 0 0 23px; margin-top: 1px; border: 1px solid currentColor; border-radius: 50%; font: 600 13px/1 var(--font); }
:is(body, .customer-page) .global-notice > span { flex: 1; min-width: 0; }
:is(body, .customer-page) .global-notice > button { margin: -3px -4px -3px auto; flex: 0 0 30px; width: 30px; min-height: 30px; border: 0; border-radius: 50%; color: inherit; background: transparent; font-size: 21px; }
.global-notice > button:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
:is(body, .customer-page) .global-notice.error { color: var(--interface-danger); background: color-mix(in srgb, #c83d50 6%, var(--surface)); border-color: color-mix(in srgb, #c83d50 23%, var(--line)); }
.global-notice.error::before { content: "!"; }
:is(body, .customer-page) :is(.form-error, .login-error) { margin-top: 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, #c83d50 22%, var(--line)); border-radius: 14px; color: var(--interface-danger); background: color-mix(in srgb, #c83d50 5%, var(--surface)); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
:is(body, .customer-page) .secret-warning { padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; line-height: 1.75; }
:is(body, .customer-page) .secret-warning p { color: var(--accent-text); }
:is(body, .customer-page) .notice { padding: 15px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--page); color: var(--muted); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] { animation: interface-dialog-in .19s cubic-bezier(.2,.75,.2,1); }
  .global-notice:not([hidden]) { animation: interface-notice-in .18s ease-out; }
}
@keyframes interface-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes interface-notice-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 620px) {
  :is(body, .customer-page) dialog.modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 24px 21px; border-radius: 22px; }
  :is(body, .customer-page) .modal-heading h2 { font-size: 24px; }
  :is(body, .customer-page) .field :is(input, select, textarea) { font-size: 16px; }
  :is(body, .customer-page) .modal-footer .button { flex: 1 1 auto; min-height: 46px; }
  :is(body, .customer-page) :is(.account-tabs, .customer-auth-switch) { flex-wrap: wrap; }
  :is(body, .customer-page) :is(.account-tabs, .customer-auth-switch) button { flex: 1 1 auto; }
  :is(body, .customer-page) .global-notice { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(body, .customer-page) :is(.button, .icon-button, .global-notice, dialog.modal, input, textarea) { animation: none !important; transition: none !important; }
}
