/* =====================================================
   Shared Hosting CRM — Auth Shell
   ログイン・インストール画面
   ===================================================== */

:root {
  color-scheme: light;
  --c-bg:        #f2f4f6;
  --c-surface:   #ffffff;
  --c-surface-2: #f8f9fa;
  --c-border:    #e2e5e9;
  --c-ink:       #111827;
  --c-ink-2:     #374151;
  --c-muted:     #6b7280;
  --c-muted-lt:  #9ca3af;
  --c-accent:    #0d7a74;
  --c-accent-dk: #085952;
  --c-accent-lt: #e6f7f5;
  --c-success:   #059669;
  --c-warn:      #b45309;
  --c-warn-lt:   #fffbeb;
  --c-danger:    #dc2626;
  --c-danger-lt: #fef2f2;
  --c-info:      #0369a1;
  --c-info-lt:   #f0f9ff;
  --sh-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.04);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: clip; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  color: var(--c-ink);
  font-family: "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

body.auth-page a {
  color: var(--c-accent-dk);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

body.auth-page a:hover { color: var(--c-accent); }

body.auth-page p, body.auth-page a, body.auth-page button,
body.auth-page label, body.auth-page strong, body.auth-page input,
body.auth-page select, body.auth-page textarea, body.auth-page li {
  overflow-wrap: anywhere;
}

/* ─── シェル ─── */
main.auth-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 32px 18px 56px;
  display: grid;
  gap: 20px;
}

main.auth-shell--compact { width: min(100%, 960px); }
main.auth-shell--center { place-content: center; min-height: 100vh; }
body.auth-page--login main.auth-shell { width: min(100%, 1060px); }
body.auth-page--forgot main.auth-shell,
body.auth-page--reset main.auth-shell { width: min(100%, 720px); }
body.auth-page--install main.auth-shell { width: min(100%, 1120px); }

/* ─── ヒーロー ─── */
.auth-hero, .hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-2xl);
  background: var(--c-surface);
  box-shadow: var(--sh-md);
}

.auth-hero::before {
  content: "";
  position: absolute;
  width: 200px; height: 200px;
  right: -80px; top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13,122,116,0.1), transparent 70%);
  pointer-events: none;
}

.auth-hero > *, .hero > * { position: relative; z-index: 1; }

/* ─── ブランド ─── */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
}

.auth-brand__mark {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  display: block;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--c-accent-lt);
  border: 1px solid rgba(13,122,116,0.12);
  box-shadow: var(--sh-sm);
}

.auth-brand__text { display: grid; gap: 2px; min-width: 0; }
.auth-brand__text strong { color: var(--c-ink); font-size: 15px; line-height: 1.2; }
.auth-brand__text span { color: var(--c-muted); font-size: 12px; line-height: 1.4; }

/* ─── ショーケース ─── */
.auth-hero--showcase {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.85fr);
  align-items: center;
  gap: 20px;
}

.auth-hero__copy { display: grid; gap: 14px; min-width: 0; }

.auth-visual-card {
  display: grid;
  gap: 12px;
  align-self: stretch;
  padding: 14px;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.auth-visual-card img { width: 100%; height: auto; display: block; border-radius: var(--r-lg); }
.auth-visual-card p, .brand-spotlight__copy p { font-size: 13px; }

/* ─── Eyebrow ─── */
.auth-hero__eyebrow, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--c-accent-lt);
  color: var(--c-accent-dk);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ─── タイトル・テキスト ─── */
.auth-title, .auth-hero h1, .card h1, .hero h1, .auth-panel h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  font-size: clamp(26px, 3.5vw, 40px);
  color: var(--c-ink);
}

.auth-hero__lead, .auth-hero p, .hero p, .card p, .auth-panel p,
.step-help, .hint, .support-line {
  margin: 0;
  color: var(--c-muted);
  line-height: 1.75;
}

.auth-hero__lead, .auth-hero p { max-width: 56ch; font-size: 14px; }

.auth-meta, .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--c-muted);
  font-size: 14px;
}

.auth-meta strong, .meta strong { color: var(--c-ink); }

/* ─── パネル・カード ─── */
.auth-panel, .card, .hero, .side-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
}

.auth-panel, .card, .hero { padding: 24px 26px; }

.auth-panel {
  display: grid;
  gap: 16px;
}

.auth-panel--stack { gap: 18px; }

.auth-panel--center {
  width: min(100%, 540px);
  justify-self: center;
}

/* ─── スプリットレイアウト ─── */
.auth-split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

/* ─── 通知・エラー ─── */
.notice, .error, .operator {
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.notice {
  background: var(--c-info-lt);
  color: var(--c-info);
  border: 1px solid rgba(3,105,161,0.15);
}

.error {
  background: var(--c-danger-lt);
  color: var(--c-danger);
  border: 1px solid rgba(220,38,38,0.15);
}

.operator {
  background: var(--c-warn-lt);
  color: var(--c-warn);
  border: 1px solid rgba(180,83,9,0.18);
}

.operator a { display: inline-block; margin-top: 6px; font-weight: 700; word-break: break-all; }

/* ─── フォーム ─── */
form { display: grid; gap: 14px; min-width: 0; }

label, .field { display: grid; gap: 6px; }

label {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-ink-2);
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  padding: 12px 14px;
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  transition: border-color 140ms, box-shadow 140ms;
}

textarea { min-height: 104px; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--c-muted-lt); }

input:hover, select:hover, textarea:hover {
  border-color: rgba(13,122,116,0.3);
}

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(13,122,116,0.35);
  outline-offset: 2px;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(13,122,116,0.1);
}

.hint, .support-line { font-size: 13px; }

/* ─── ボタン ─── */
button, .button, .pill, .wizard-tab { font: inherit; }

button, .button {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  min-height: 48px;
  padding: 12px 20px;
  max-width: 100%;
  white-space: normal;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 140ms, border-color 140ms, box-shadow 140ms, transform 120ms;
}

button {
  color: #fff;
  background: var(--c-accent);
  border-color: var(--c-accent-dk);
  box-shadow: 0 2px 8px rgba(13,122,116,0.2);
}

button:hover, .button:hover { transform: translateY(-1px); }
button:hover { background: var(--c-accent-dk); box-shadow: 0 4px 12px rgba(13,122,116,0.25); }
button:active, .button:active, .pill:active { transform: translateY(0); }

button.subtle, .button.subtle {
  color: var(--c-ink-2);
  background: var(--c-surface);
  border-color: var(--c-border);
  box-shadow: var(--sh-sm);
}

button.subtle:hover, .button.subtle:hover {
  background: var(--c-surface-2);
  border-color: rgba(13,122,116,0.25);
}

button:disabled {
  background: var(--c-surface-2);
  border-color: var(--c-border);
  color: var(--c-muted-lt);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ─── リンク ─── */
.inline-link, .auth-links {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0;
  text-align: center;
}

.inline-link a, .auth-links a { font-weight: 700; }
.support-line { text-align: center; }

/* ─── インストールレイアウト ─── */
.auth-install-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.75fr);
}

.auth-install-layout > * { min-width: 0; }

.hero { display: grid; gap: 16px; }
.hero .eyebrow { margin-bottom: 4px; }

.card h2, .card h3, .hero h2, .hero h3, .side-card h3 {
  margin: 0; font-weight: 700; letter-spacing: 0.01em;
}

.card h2 { font-size: clamp(18px, 2vw, 26px); line-height: 1.25; }
.card h3, .side-card h3 { font-size: 16px; line-height: 1.3; }

/* ─── ウィザード ─── */
.wizard-progress {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 20px;
}

.wizard-tab {
  display: grid;
  gap: 3px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  padding: 12px 14px;
  text-align: left;
  min-height: 76px;
  cursor: pointer;
  appearance: none;
  font: inherit;
  transition: background 140ms, border-color 140ms, box-shadow 140ms, transform 120ms;
}

.wizard-tab span { font-size: 11px; color: var(--c-muted); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.wizard-tab strong { font-size: 14px; color: var(--c-ink); font-weight: 700; }

.wizard-tab.is-active {
  border-color: rgba(13,122,116,0.35);
  background: var(--c-accent-lt);
  box-shadow: 0 2px 8px rgba(13,122,116,0.12);
}

.wizard-tab.is-active span,
.wizard-tab.is-active strong { color: var(--c-accent-dk); }

.wizard-tab:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }

.wizard-step + .wizard-step { margin-top: 20px; }
.step-help { margin-bottom: 16px; }

/* ─── グリッド ─── */
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ─── ピル ─── */
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  border: 1px solid var(--c-border);
  border-radius: 99px;
  background: var(--c-surface);
  color: var(--c-ink-2);
  min-height: 38px;
  padding: 7px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  transition: background 140ms, border-color 140ms;
}

.pill:hover { background: var(--c-surface-2); border-color: rgba(13,122,116,0.25); }

/* ─── チョイスカード ─── */
.choice {
  display: grid;
  gap: 5px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  padding: 14px;
}

.choice strong { display: block; font-size: 14px; color: var(--c-ink); }
.choice p { margin: 0; font-size: 13px; color: var(--c-muted); }

/* ─── サマリー ─── */
.summary-list, .bullet-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: var(--c-muted);
  font-size: 14px;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.summary-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  padding: 10px 12px;
}

.summary-item strong { font-size: 11px; color: var(--c-muted); margin: 0; font-weight: 600; }
.summary-item span { font-size: 15px; font-weight: 700; color: var(--c-ink); word-break: break-word; }

/* ─── ウィザードフッター ─── */
.wizard-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
}

.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── サイドスタック ─── */
.side-stack {
  display: grid;
  gap: 14px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.side-card {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.side-card .choice + .choice { margin-top: 10px; }

/* ─── ブランドスポットライト ─── */
.brand-spotlight { display: grid; gap: 12px; }

.brand-spotlight__image {
  width: min(100%, 200px);
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  display: block;
  object-fit: cover;
  justify-self: center;
  background: var(--c-accent-lt);
  border: 1px solid rgba(13,122,116,0.1);
  box-shadow: var(--sh-sm);
}

.brand-spotlight__copy { display: grid; gap: 5px; }
.wizard-footer__note { margin: 0; }
.stacked-choice { margin-top: 10px; }

code {
  background: var(--c-surface-2);
  color: var(--c-ink-2);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.9em;
}

/* ─── レスポンシブ ─── */
@media (max-width: 980px) {
  .auth-install-layout { grid-template-columns: 1fr; }
  .side-stack { position: static; }
  .wizard-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-hero--showcase { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  main.auth-shell--center { min-height: auto; place-content: start; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel, .card, .hero { padding: 20px; }
  .auth-hero { padding: 20px; }
}

@media (max-width: 640px) {
  main.auth-shell { padding: 14px 12px 36px; }
  .auth-hero { gap: 12px; }
  .auth-panel, .card, .hero { padding: 18px; border-radius: var(--r-xl); }
  .auth-hero__eyebrow, .eyebrow { min-height: 26px; padding: 3px 9px; font-size: 11px; }
  .auth-title, .auth-hero h1, .card h1, .hero h1, .auth-panel h1 { font-size: clamp(22px, 7vw, 32px); }
  .grid { grid-template-columns: 1fr; }
  .wizard-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: 1fr; }
  .wizard-footer { align-items: stretch; }
  .button-row { width: 100%; display: grid; grid-template-columns: 1fr; }
  .button-row button, .button-row .button { width: 100%; }
  .inline-link, .auth-links, .support-line { text-align: left; justify-items: start; }
  .auth-panel--center { width: 100%; }
  .auth-brand { gap: 10px; }
  .auth-brand__mark { width: 44px; height: 44px; }
  .auth-visual-card { padding: 10px; border-radius: var(--r-lg); }
}

@media (max-width: 420px) {
  .wizard-progress { grid-template-columns: 1fr; }
}
