/* ========================================
   Base / Variables
   ======================================== */
:root {
  --white: #ffffff;
  --beige: #f7f3ee;
  --beige-light: #faf8f5;
  --blue: #c5dde8;
  --blue-light: #e8f2f7;
  --blue-accent: #7bb8d0;
  --green: #9ec5b4;
  --green-light: #e2f0e9;
  --green-accent: #6ba68e;
  --text: #2e2e2e;
  --text-light: #4a4a4a;
  --text-muted: #737373;
  --danger: #e74c3c;
  --warning: #f39c12;
  --font-en: 'Hiragino Mincho ProN', 'ヒラギノ明朝 ProN', 'Noto Serif JP', serif;
  --font-ja: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', 'Noto Sans JP', sans-serif;
  --font-ja-mincho: 'Hiragino Mincho ProN', 'ヒラギノ明朝 ProN', 'Noto Serif JP', serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-ja);
  color: var(--text);
  background: var(--beige-light);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.logo {
  font-family: var(--font-en);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
}

.logo small {
  font-family: var(--font-ja);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.nav ul {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-light);
  transition: color 0.3s;
  padding: 6px 0;
}

.nav a:hover,
.nav a.nav-active {
  color: var(--blue-accent);
}

.nav-logout {
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 4px 16px !important;
  transition: all 0.3s !important;
}

.nav-logout:hover {
  background: rgba(0,0,0,0.04);
}

.nav-close {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

/* ========================================
   Page Hero
   ======================================== */
.page-hero {
  padding: 100px 0 40px;
  text-align: center;
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--beige-light) 100%);
}

.page-hero-label {
  font-family: var(--font-en);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--blue-accent);
  margin-bottom: 6px;
}

.page-hero-title {
  font-family: var(--font-ja-mincho);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.page-hero-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ========================================
   Main Content
   ======================================== */
.member-main {
  padding: 40px 0 80px;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.card-sm {
  padding: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 3px solid var(--blue-accent);
}

.card-title-green {
  border-left-color: var(--green-accent);
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.dash-card {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.dash-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.dash-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dash-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Profile Card
   ======================================== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--white);
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.profile-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 20px;
  letter-spacing: 0.08em;
}

.profile-type.tiare {
  background: var(--blue-light);
  color: var(--blue-accent);
}

.profile-type.moana {
  background: var(--green-light);
  color: var(--green-accent);
}

/* ========================================
   Balance Summary
   ======================================== */
.balance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.balance-item {
  text-align: center;
  padding: 20px 12px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.balance-num {
  font-family: var(--font-en);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.balance-num.purchased { color: var(--blue-accent); }
.balance-num.used { color: var(--text-muted); }
.balance-num.remaining { color: var(--green-accent); }

.balance-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

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

.form-label .required {
  color: var(--danger);
  font-size: 0.7rem;
  margin-left: 4px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: var(--font-ja);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px rgba(123, 184, 208, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

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

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   Radio / Checkbox
   ======================================== */
.radio-group {
  display: flex;
  gap: 12px;
}

.radio-card {
  flex: 1;
  padding: 16px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.radio-card:hover {
  border-color: var(--blue-accent);
}

.radio-card.selected {
  border-color: var(--blue-accent);
  background: var(--blue-light);
}

.radio-card input[type="radio"] {
  display: none;
}

.radio-card-label {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.radio-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--beige-light);
  border-radius: 10px;
}

.checkbox-wrap input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--green-accent);
}

.checkbox-wrap label {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-light);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 40px;
  border: none;
  border-radius: 50px;
  font-family: var(--font-ja);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.btn-primary {
  background: var(--green-accent);
  color: var(--white);
}

.btn-primary:hover {
  background: #5a9479;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(107, 166, 142, 0.3);
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.btn-secondary:hover {
  background: var(--beige-light);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

/* ========================================
   Tables
   ======================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  letter-spacing: 0.04em;
}

.data-table td {
  font-size: 0.85rem;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--beige-light);
}

/* ========================================
   Price Table (Purchase)
   ======================================== */
.price-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.price-option {
  padding: 16px 8px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.price-option:hover {
  border-color: var(--blue-accent);
  transform: translateY(-2px);
}

.price-option.selected {
  border-color: var(--blue-accent);
  background: var(--blue-light);
}

.price-option-count {
  font-family: var(--font-en);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--blue-accent);
  line-height: 1;
}

.price-option-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.price-option-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.price-option-per {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ========================================
   Status Badge
   ======================================== */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.badge-pending {
  background: #fef3cd;
  color: #856404;
}

.badge-confirmed {
  background: var(--green-light);
  color: var(--green-accent);
}

.badge-active {
  background: var(--green-light);
  color: var(--green-accent);
}

.badge-tiare {
  background: var(--blue-light);
  color: var(--blue-accent);
}

.badge-moana {
  background: var(--green-light);
  color: var(--green-accent);
}

/* ========================================
   Alerts / Messages
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.alert-error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-success {
  background: var(--green-light);
  color: #2d6a4f;
  border: 1px solid rgba(107, 166, 142, 0.2);
}

.alert-info {
  background: var(--blue-light);
  color: #1a6b8a;
  border: 1px solid rgba(123, 184, 208, 0.2);
}

/* ========================================
   Payment Info
   ======================================== */
.payment-info {
  background: var(--beige);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.payment-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.payment-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 0.85rem;
}

.payment-info dt {
  font-weight: 500;
  color: var(--text-muted);
}

.payment-info dd {
  font-weight: 600;
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 28px;
}

.tab {
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-ja);
}

.tab.active {
  color: var(--blue-accent);
  border-bottom-color: var(--blue-accent);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========================================
   Month Selector
   ======================================== */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.month-label {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 120px;
  text-align: center;
}

.month-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.month-btn:hover {
  background: var(--blue-light);
  border-color: var(--blue-accent);
}

/* ========================================
   Loading
   ======================================== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.loading::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border: 3px solid var(--blue-light);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* ========================================
   Flower Pattern Background
   ======================================== */
body {
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('images/flower-tile.png') repeat;
  background-size: 800px;
  mix-blend-mode: multiply;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.header,
.page-hero,
.member-main,
.footer,
.member-login,
.member-register {
  position: relative;
  z-index: 1;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav {
    display: none;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #ffffff;
    z-index: 99999;
    padding: 80px 32px;
    overflow-y: auto;
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
  }

  .nav a {
    font-size: 1rem;
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-logout {
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 0 !important;
    padding: 16px 0 !important;
    font-size: 1rem !important;
    text-align: left;
  }

  .nav-close {
    display: block;
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text);
  }

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

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .price-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
  }

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

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .price-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-inner {
    padding: 12px 16px;
  }

  .container,
  .container-wide {
    padding: 0 16px;
  }

  .card {
    padding: 20px;
    border-radius: 12px;
  }

  .page-hero {
    padding: 90px 0 32px;
  }

  .page-hero-title {
    font-size: 1.3rem;
  }
}
