:root {
  --color-brand: #1a6b3c;
  --color-brand-dark: #145530;
  --color-brand-light: #e8f5ee;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-border: #d1d5db;
  --color-bg: #f5f5f5;
  --color-surface: #fff;
  --color-error: #e53935;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── ヘッダー ─── */

.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-brand);
}

.header-logo img {
  height: 32px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
  font-size: 22px;
  color: var(--color-text);
}

.menu-btn:hover {
  background: #f9fafb;
}

/* ─── ドロップダウンメニュー ─── */

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.menu-overlay.is-open {
  display: block;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.menu-dropdown {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 201;
}

.menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: background 120ms;
}

.menu-dropdown a:last-child {
  border-bottom: none;
}

.menu-dropdown a:hover {
  background: var(--color-brand-light);
}

.menu-dropdown a.is-active {
  color: var(--color-brand);
  font-weight: 700;
}

.menu-dropdown .menu-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-dropdown .menu-logout {
  color: var(--color-error);
}

/* ─── メインコンテンツ ─── */

.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ─── ログイン画面 ─── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e8f5ee 0%, var(--color-bg) 100%);
}

.login-card {
  width: min(100% - 32px, 420px);
  background: var(--color-surface);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  padding: 40px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-brand);
  margin-top: 12px;
}

.login-form {
  display: grid;
  gap: 20px;
}

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

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  background: var(--color-surface);
  transition: border-color 200ms;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(26, 107, 60, 0.12);
}

.field input.is-error,
.field select.is-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12);
}

.error-message {
  min-height: 18px;
  color: var(--color-error);
  font-size: 13px;
  line-height: 1.4;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: var(--color-brand);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms, transform 120ms;
}

.btn-primary:hover {
  background: var(--color-brand-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms;
}

.btn-secondary:hover {
  background: #f9fafb;
}

/* ─── ダッシュボード ─── */

.dashboard-grid {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--color-surface);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.balance-item {
  padding: 16px;
  border-radius: 10px;
  background: var(--color-brand-light);
}

.balance-label {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.balance-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-brand);
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tx-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid #f0f0f0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.tx-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f5f5f5;
}

.tx-table .tx-amount {
  text-align: right;
  font-weight: 600;
}

.tx-table .tx-minus {
  color: var(--color-error);
}

.tx-table .tx-plus {
  color: var(--color-brand);
}

.notice-list {
  list-style: none;
}

.notice-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}

.notice-list li:last-child {
  border-bottom: none;
}

.notice-date {
  font-size: 12px;
  color: var(--color-muted);
  margin-right: 8px;
}

/* ─── 設定メニュー ─── */

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 120ms, box-shadow 120ms;
}

.settings-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-item-label {
  font-size: 16px;
  font-weight: 600;
}

.settings-item-arrow {
  color: var(--color-muted);
  font-size: 18px;
}

.settings-item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── パンくずリスト ─── */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--color-brand);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--color-text);
  font-weight: 600;
}

/* ─── アカウント情報 ─── */

.account-list {
  display: grid;
  gap: 0;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.account-row:last-child {
  border-bottom: none;
}

.account-row-info {
  flex: 1;
}

.account-row-label {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.account-row-value {
  font-size: 15px;
}

.btn-change {
  padding: 8px 18px;
  border: 1px solid var(--color-brand);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms;
  text-decoration: none;
  display: inline-flex;
}

.btn-change:hover {
  background: var(--color-brand-light);
}

/* ─── 住所変更フォーム ─── */

.current-address {
  padding: 16px 18px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 24px;
}

.current-address-label {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.current-address-value {
  font-size: 15px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.postal-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.postal-group .field {
  flex: 1;
}

.btn-search {
  margin-top: 26px;
  padding: 12px 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #f9fafb;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms;
}

.btn-search:hover {
  background: #f0f0f0;
}

.field-optional {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 400;
  margin-left: 6px;
}

.badge-required {
  display: inline-block;
  background: var(--color-error);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.form-error-summary {
  display: none;
  padding: 14px 18px;
  background: #fff0f0;
  border: 1px solid var(--color-error);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #c62828;
  font-weight: 600;
}

.form-error-summary.is-visible {
  display: block;
}

.form-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

/* ─── 確認画面 ─── */

.confirm-list {
  display: grid;
  gap: 0;
}

.confirm-row {
  display: flex;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  padding-top: 2px;
}

.confirm-value {
  flex: 1;
  font-size: 15px;
}

.confirm-actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

/* ─── 完了画面 ─── */

.complete-card {
  text-align: center;
  padding: 48px 24px;
}

.complete-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.complete-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.complete-description {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.8;
  margin-bottom: 32px;
}

/* ─── フッター ─── */

.footer {
  background: var(--color-bg);
  padding: 28px 20px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  margin-top: 40px;
}

.footer-info {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.footer-copyright {
  font-size: 11px;
  color: #9ca3af;
}

/* ─── レスポンシブ ─── */

@media (max-width: 768px) {
  .main-content {
    padding: 20px 16px 40px;
  }

  .balance-grid {
    grid-template-columns: 1fr;
  }

  .tx-table {
    font-size: 13px;
  }

  .account-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .confirm-row {
    flex-direction: column;
    gap: 4px;
  }

  .confirm-label {
    width: auto;
  }

  .postal-group {
    flex-direction: column;
  }

  .btn-search {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }

  .card {
    padding: 18px;
  }
}
