/* ================================================
   Voice Portfolio Generator — 共通デザインシステム
   仕様書 §4 準拠
   ================================================ */

/* ---- Google Fonts (HTMLの<head>に<link>で読み込み) ---- */

/* ================================================
   Design Tokens
   ================================================ */
:root {
  /* Color */
  --bg:          #FAFAFA;
  --text:        #2D2D2D;
  --navy:        #1A1A40;
  --accent:      #2A7A6E;
  --accent-rgb:  42, 122, 110;
  --accent-light: rgba(42, 122, 110, 0.10);
  --gray-100:    #F5F5F5;
  --gray-200:    #EEEEEE;
  --gray-300:    #E0E0E0;
  --gray-400:    #BDBDBD;
  --gray-500:    #9E9E9E;
  --gray-600:    #757575;
  --gray-700:    #616161;
  --danger:      #E74C3C;
  --success:     #27AE60;

  /* Typography */
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --section-gap:   32px;
  --card-pad:      24px;
  --page-margin:   24px;
  --page-max:      640px;
  --radius:        16px;
  --radius-sm:     10px;

  /* Transition */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.3s;
}

/* ================================================
   Reset
   ================================================ */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

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

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ================================================
   Page Container
   ================================================ */
.page {
  width: 100%;
  max-width: var(--page-max);
  padding: 40px var(--page-margin) 100px;
  animation: fadeIn var(--duration) var(--ease) both;
}

/* ================================================
   Typography
   ================================================ */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: var(--section-gap);
  line-height: 1.6;
}

.section-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-heading::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ================================================
   Card
   ================================================ */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--card-pad);
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  animation: fadeInUp var(--duration) var(--ease) both;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease),
    transform 0.15s var(--ease),
    box-shadow var(--duration) var(--ease);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: #238071;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
}

.btn-primary:disabled {
  background: var(--gray-400);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-100);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

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

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

.form-label .optional {
  font-weight: 400;
  color: var(--gray-500);
  font-size: 0.75rem;
  margin-left: 4px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--duration) var(--ease);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-input::placeholder {
  color: var(--gray-400);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ================================================
   Step Indicator
   ================================================ */
.step-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray-200);
  z-index: 100;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: all var(--duration) var(--ease);
  position: relative;
}

.step-dot.completed {
  background: var(--accent);
}

.step-dot.completed::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6px;
  color: #fff;
  font-weight: 900;
}

.step-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
  transform: scale(1.2);
}

.step-line {
  width: 24px;
  height: 2px;
  background: var(--gray-300);
  border-radius: 1px;
}

.step-line.completed {
  background: var(--accent);
}

/* ================================================
   Loading Overlay
   ================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 200;
  animation: fadeIn 0.2s var(--ease) both;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.progress-bar-wrap {
  width: 200px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s var(--ease);
}

/* ================================================
   Back Link
   ================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--gray-600);
  text-decoration: none;
  margin-top: 12px;
  transition: color var(--duration) var(--ease);
}

.back-link:hover {
  color: var(--accent);
}

/* ================================================
   Alerts
   ================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.alert-success {
  background: #EAFAF1;
  color: var(--success);
  border: 1px solid rgba(39,174,96,0.2);
}

.alert-warning {
  background: #FEF9E7;
  color: #B7950B;
  border: 1px solid rgba(183,149,11,0.2);
}

/* ================================================
   Animations
   ================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 480px) {
  :root {
    --page-margin: 16px;
    --card-pad: 16px;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.85rem;
  }
}
