/* ============================================================
   auth.css — 認証ページ共通スタイル
   対象: login.html, signup.html, account.html
   ============================================================ */

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

:root {
  --navy:        #0F172A;
  --navy-mid:    #1E293B;
  --navy-light:  #334155;
  --accent:      #2563EB;
  --accent-dark: #1D4ED8;
  --success:     #10B981;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --text-primary:   #111827;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --border:      #E2E8F0;
  --bg-page:     #F1F5F9;
  --bg-card:     #FFFFFF;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow-card: 0 4px 6px -1px rgba(15,23,42,.07), 0 20px 40px -8px rgba(15,23,42,.10);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ヘッダー ── */
.auth-header {
  background: var(--navy);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.auth-header-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #E2E8F0;
}

.auth-logo-icon { font-size: 1.4rem; }
.auth-logo-text { font-size: .9rem; font-weight: 700; }

.auth-header-link {
  font-size: .85rem;
  color: #94A3B8;
  text-decoration: none;
  transition: color .2s;
}
.auth-header-link:hover { color: #E2E8F0; }

/* ── メインレイアウト ── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}

/* ── カード ── */
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.auth-card-sub {
  font-size: .875rem;
  color: var(--text-secondary);
  margin: 0 0 28px;
  line-height: 1.6;
}

/* ── フォーム部品 ── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #FFFFFF;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-control.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

/* ── ボタン ── */
.btn-auth-primary {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: background .2s, transform .15s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.btn-auth-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

.btn-auth-primary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.btn-auth-secondary {
  display: block;
  width: 100%;
  padding: 11px 20px;
  background: transparent;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .2s, color .2s;
  margin-top: 10px;
}
.btn-auth-secondary:hover { background: rgba(37,99,235,.06); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: transparent;
  color: var(--danger);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s;
}
.btn-danger:hover { background: rgba(239,68,68,.06); }

/* ── スピナー ── */
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-auth-primary .spinner-sm { display: none; }
.btn-auth-primary.loading .spinner-sm { display: inline-block; }
.btn-auth-primary.loading .btn-text { display: none; }

/* ── アラート ── */
.auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  line-height: 1.55;
  margin-bottom: 18px;
  display: none;
}

.auth-alert.show { display: block; }

.auth-alert.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.auth-alert.success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.auth-alert.info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

/* ── 区切り ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── リンク行 ── */
.auth-link-row {
  text-align: center;
  font-size: .875rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

.auth-link-row a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-link-row a:hover { text-decoration: underline; }

/* ── メール確認バナー ── */
.verify-banner {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  display: none;
}
.verify-banner.show { display: block; }
.verify-banner-icon { font-size: 2.4rem; margin-bottom: 10px; }
.verify-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: #065F46;
  margin: 0 0 6px;
}
.verify-banner-desc {
  font-size: .875rem;
  color: #047857;
  line-height: 1.6;
  margin: 0;
}

/* ── アカウントページ専用 ── */
.account-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
}

.account-card-header {
  background: var(--navy);
  padding: 28px 32px;
  color: #E2E8F0;
}

.account-card-header h1 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.account-card-header p {
  font-size: .85rem;
  color: #94A3B8;
  margin: 0;
}

.account-card-body {
  padding: 28px 32px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--text-secondary); font-weight: 500; }
.info-row-value { color: var(--text-primary); font-weight: 600; }

/* ステータスバッジ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: .8rem;
  font-weight: 700;
}
.status-badge.active, .status-badge.trialing {
  background: #D1FAE5;
  color: #065F46;
}
.status-badge.canceled, .status-badge.unpaid,
.status-badge.past_due, .status-badge.incomplete,
.status-badge.incomplete_expired, .status-badge.none {
  background: #FEE2E2;
  color: #991B1B;
}

.account-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-open-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s;
}
.btn-open-app:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  color: var(--navy-light);
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-portal:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.no-subscription-box {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: .875rem;
  color: #92400E;
  line-height: 1.6;
  margin-top: 18px;
}
.no-subscription-box a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.no-subscription-box a:hover { text-decoration: underline; }

/* ── フッター ── */
.auth-footer {
  text-align: center;
  padding: 20px;
  font-size: .8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.auth-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 8px;
}
.auth-footer a:hover { color: var(--text-secondary); }

/* ── レスポンシブ ── */
@media (max-width: 480px) {
  .auth-card, .account-card { padding: 28px 20px; }
  .account-card-header, .account-card-body { padding: 22px 20px; }
  .auth-card-title { font-size: 1.3rem; }
}
