/* public/style.css */
:root {
  --primary-color: #2F80ED;
  --bg-gradient: linear-gradient(135deg, #e6f2ee 0%, #eff6ff 100%);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 10px 40px rgba(47, 128, 237, 0.1);
  --text-main: #334155;
  --text-light: #64748b;
  --text-dark: #0f172a;
  --accent: #3b82f6;
  --error: #ef4444;
  --success: #22c55e;
}

body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.app-wrapper {
  width: 100%;
  max-width: 780px;
  min-height: 500px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Typography & Layout */
.app-header {
  padding: 32px 40px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 100%);
}
.survey-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.survey-title, .org-name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.survey-title .highlight {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-color);
  display: block;
  margin-top: 4px;
}

.app-content, .survey-content {
  flex-grow: 1;
  padding: 0 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main-text-box {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-main);
}

/* Animations */
@keyframes fadeInSlideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.start-form, .main-text-box, #question-container, .complete-view {
  animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Form Styles */
.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
}
.form-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
  background: #ffffff;
}
.form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  width: 100%;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.4);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-secondary {
  background: transparent;
  border: 2px solid #e2e8f0;
  color: var(--text-light);
  font-size: 0.95rem;
  padding: 12px 20px;
}
.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-dark);
  border-color: #cbd5e1;
}
.btn-icon {
  width: 20px;
  height: 20px;
  margin-left: 10px;
}
.btn-icon-prev {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

/* Survey Question UI */
.question-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  margin-top: 30px;
  line-height: 1.5;
}
.question-sub {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin: 16px 0 32px;
  padding: 24px;
  background: rgba(47, 128, 237, 0.04);
  border: 2px solid rgba(47, 128, 237, 0.15);
  border-radius: 16px;
  line-height: 1.4;
}
.question-note {
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: inline-block;
}

/* Option Buttons & Input */
.options-grid {
  display: grid;
  gap: 12px;
}
.option-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: 18px 24px;
  border-radius: 14px;
  font-size: 1.05rem;
  color: var(--text-main);
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}
.option-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateX(4px);
}
.option-btn:active {
  background: #e2e8f0;
}
.option-btn.selected {
  border-color: var(--primary-color);
  background: rgba(47, 128, 237, 0.08);
  color: var(--primary-color);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--primary-color);
}
.free-text-area {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 16px;
}
.free-text-area:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.btn-row-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.navigation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* Progress bar */
.progress-container {
  margin-top: 16px;
}
.progress-bar-bg {
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-text {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 6px;
}

/* Complete View */
.complete-view {
  text-align: center;
  padding: 20px 0;
}
.success-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 16px rgba(34, 197, 94, 0.2);
}
.success-icon svg { width: 36px; height: 36px; }
.complete-view h2 { color: var(--text-dark); margin-bottom: 16px; }
.complete-view p { color: var(--text-light); line-height: 1.6; }

/* Utilities */
.app-footer {
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  background: rgba(248, 250, 252, 0.5);
}
.error-msg {
  color: var(--error);
  background: #fef2f2;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 4px solid var(--error);
}

/* Loading */
.loading-spinner {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s infinite cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Mobile optimization */
@media (max-width: 600px) {
  body { padding: 12px; }
  .app-wrapper { border-radius: 16px; min-height: calc(100vh - 24px); }
  .app-header { padding: 24px 20px; }
  .app-content, .survey-content { padding: 0 20px 30px; }
  .survey-header { padding: 20px 20px 12px; }
  .option-btn { padding: 16px 20px; }
}
