/* =====================================================
   Japan eSIM — Shared Design System
   Brand: Samurai × Japanese Modern
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Sans:wght@300;400;500;600;700&display=swap');

/* ─── Custom Properties ─── */
:root {
  --bg-base:        #070c1a;
  --bg-mid:         #0d1427;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --gold:           #c9a84c;
  --gold-light:     #e8c96d;
  --gold-dim:       rgba(201,168,76,0.25);
  --gold-glow:      rgba(201,168,76,0.12);
  --teal:           #1a9fa0;
  --teal-dim:       rgba(26,159,160,0.2);
  --red-jp:         #c0392b;
  --text-primary:   #f0ede6;
  --text-secondary: #8a8d9e;
  --text-muted:     #52556a;
  --border:         rgba(201,168,76,0.15);
  --border-strong:  rgba(201,168,76,0.4);
  --shadow:         0 8px 40px rgba(0,0,0,0.5);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.3);
  --radius:         14px;
  --radius-sm:      8px;
  --radius-xs:      4px;
  --font-heading:   'Cinzel', serif;
  --font-body:      'Noto Sans', sans-serif;
  --nav-h:          72px;

  /* Plan colors */
  --plan-1-from: #1a6fd4;
  --plan-1-to:   #12c5c5;
  --plan-2-from: #1a55d4;
  --plan-2-to:   #5b12d4;
  --plan-3-from: #84c028;
  --plan-3-to:   #d4c212;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; border: none; }
input, select, textarea { font-family: var(--font-body); }
ul { list-style: none; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ─── Typography ─── */
h1,h2,h3 { font-family: var(--font-heading); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }

/* ─── Layout ─── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(7,12,26,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-mark {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--text-primary);
}
.nav-logo-text span {
  color: var(--gold);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); background: var(--bg-card); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.currency-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}
.currency-select option { background: var(--bg-mid); }
.nav-mypage-btn {
  padding: 7px 18px;
  background: var(--gold-dim);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-mypage-btn:hover {
  background: var(--gold);
  color: #070c1a;
}
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ─── Page top spacer ─── */
.page-top { padding-top: var(--nav-h); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #a8832a);
  color: #070c1a;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,168,76,0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--gold);
}
.btn-outline:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}
.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-card-hover); }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card:hover { border-color: rgba(201,168,76,0.3); }

/* ─── Gold divider ─── */
.gold-divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 16px auto;
}
.gold-divider.left { margin-left: 0; }

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-gold { background: var(--gold-dim); color: var(--gold-light); border: 1px solid var(--border-strong); }
.badge-teal { background: var(--teal-dim); color: var(--teal); }
.badge-green { background: rgba(132,192,40,0.15); color: #84c028; }
.badge-red   { background: rgba(192,57,43,0.15); color: #e74c3c; }

/* ─── Form elements ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}
/* ネイティブ select ドロップダウン: 白背景でも読めるよう option ごとに色を明示 */
.form-select option {
  color: #f0ede6;
  background-color: #131b2e;
}
.form-select option:disabled {
  color: #0a1020 !important;
  background-color: #e2e6ee !important;
  font-weight: 600;
  font-size: 0.78rem;
}
.form-select optgroup {
  color: #0a1020;
  background-color: #e2e6ee;
  font-weight: 600;
}

/* ─── Step indicator ─── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-heading);
  transition: all 0.3s;
}
.step-item.active .step-num {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-light);
}
.step-item.done .step-num {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
}
.step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.step-item.active .step-label { color: var(--text-primary); }
.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

/* ─── Alert / Notice ─── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-info { background: rgba(26,159,160,0.12); border: 1px solid var(--teal-dim); color: var(--teal); }
.alert-warn { background: rgba(201,168,76,0.1); border: 1px solid var(--border); color: var(--gold-light); }
.alert-success { background: rgba(132,192,40,0.1); border: 1px solid rgba(132,192,40,0.25); color: #a8d84a; }
.alert-error { background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.25); color: #e74c3c; }

/* ─── Data ring (SVG-based progress) ─── */
.data-ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.data-ring-label {
  position: absolute;
  text-align: center;
  line-height: 1.3;
}
.data-ring-label .used { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.data-ring-label .total { font-size: 0.75rem; color: var(--text-secondary); }

/* ─── Footer ─── */
.footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .nav-logo-text { font-size: 0.9rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.82rem; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Toast notification ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}
.toast.success { border-color: rgba(132,192,40,0.4); }
.toast.error { border-color: rgba(192,57,43,0.4); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Loading spinner ─── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile nav ─── */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  /* Opaque, slightly-elevated panel so it never blends into the page. */
  background: #0c1430;
  z-index: 999;
  flex-direction: column;
  padding: 20px;
  gap: 10px;
  border-top: 2px solid var(--gold-dim);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.nav-mobile a:hover,
.nav-mobile a:active {
  color: var(--gold-light);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.nav-mobile-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.nav-mobile-tools .currency-select { padding: 8px 14px; font-size: 0.9rem; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  /* Burger on the LEFT (thumb-reachable); push the rest of the bar right. */
  .nav-burger { display: flex; order: -1; }
  .nav .container { justify-content: flex-start; gap: 12px; }
  .nav-right { margin-left: auto; gap: 8px; }
  /* Keep the header from overflowing: currency + language move into the drawer. */
  .nav-right #language-switcher,
  .nav-right .currency-select { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-brand { grid-column: 1/-1; }
  .section { padding: 56px 0; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .steps { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .step-label { display: none; }
}
