/* メインスタイルシート */

/* 全体レイアウト */
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f9fafb;
  min-height: 100vh;
}

.layout-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-main {
  flex: 1 0 auto;
}

/* ヘッダー */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #1f2937;
}

.brand-logo {
  height: 60px;
  width: auto;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.main-nav .menu-pill {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.menu-link {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: #4b5563;
  font-weight: 500;
  transition: all 0.2s;
}

.menu-link:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.menu-link.is-active {
  background: #2563eb;
  color: #fff;
}

.menu-link.strong {
  background: #2563eb;
  color: #fff;
}

/* カード */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mp-whitebox {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* マイページ サイドバー */
.mp-whitebox.mpdash {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mpdash-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mpdash-toggle:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.mpdash-toggle__icon {
  font-size: 0.875rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.collapse-target {
  display: block;
}

.collapse-target.collapsed {
  display: none;
}

.mpdash .mp-menu {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #1f2937;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mpdash .mp-menu:hover {
  background: #e0f2fe;
  color: #1d4ed8;
}

.mpdash .mp-menu.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 1px #1d4ed8 inset;
}

.mpdash .mp-menu--logout {
  color: #dc2626;
}

.mpdash .mp-menu--logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.mpdash-logout {
  margin: 0;
  padding: 0;
}

.mpdash-logout button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mp-whitebox.mpdash {
    padding: 1.75rem;
  }
}

/* フォーム */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.is-invalid {
  border-color: #ef4444;
}

.required-field:invalid {
  background-color: lemonchiffon;
}
.required-field.is-empty {
  background-color: lemonchiffon;
}

.text-error {
  color: #ef4444;
}

/* テーブル */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 1.5rem;
}
th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
th {
    background: linear-gradient(90deg, #e0f2fe 0%, #bae6fd 100%);
    color: #4299E1;
    font-weight: 600;
    font-size: 1rem;
}
tr:last-child td {
    border-bottom: none;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #6b7280;
  color: #fff;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-outline {
  background: transparent;
  border: 2px solid #d1d5db;
  color: #374151;
}

.btn-outline:hover {
  border-color: #2563eb;
  color: #2563eb;
}

/* 認証ページ */
.auth-page-wrapper {
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.helper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.helper-link {
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: none;
}

.helper-link:hover {
  text-decoration: underline;
}

.register-hint {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 1rem;
  color: #6b7280;
}

.register-hint a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.register-hint a:hover {
  text-decoration: underline;
}

/* アラート */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.alert-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.alert-success {
  background: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

.alert-info {
  background: #eef;
  border: 1px solid #ccf;
  color: #33c;
}

/* ステップインジケーター */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: #9ca3af;
  position: relative;
}

.step.active {
  color: #2563eb;
  font-weight: 600;
}

.step.completed {
  color: #10b981;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .menu-pill {
    flex-wrap: wrap;
    justify-content: center;
  }

  .step {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
}
