/**
 * イベント登録ページ共通CSS
 * 各HTMLで :root の --accent 系変数を上書きしてテーマカラーを変更
 *
 * 必須カスタムプロパティ（各ページで定義）:
 *   --accent, --accent-glow, --accent-hover-bg, --accent-selected-bg
 *   --accent-gradient-end, --body-glow-color
 */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242836;
  --success: #34d399;
  --error: #f87171;
  --warn: #fbbf24;
  --text: #e8eaf0;
  --text-dim: #8b8fa3;
  --border: #2e3347;
  --radius: 14px;
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -40%; left: -20%;
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, var(--body-glow-color) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(52,211,153,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* Pre-open banner */
.pre-open-banner {
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.04));
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
}
.pre-open-banner p {
  color: var(--warn);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 500;
}
.pre-open-banner strong { font-weight: 700; }

/* Header */
.event-header {
  text-align: center;
  margin-bottom: 48px;
}
.event-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.event-header h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.event-header p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}
.event-header .info-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}
.event-header .info-tag {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}

/* Progress bar */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
  padding: 0 10px;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.progress-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text-dim);
  transition: all 0.4s ease;
}
.progress-step.active .progress-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.progress-step.done .progress-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.progress-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  white-space: nowrap;
  font-weight: 500;
}
.progress-step.active .progress-label { color: var(--accent); }
.progress-step.done .progress-label { color: var(--success); }
.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 -2px;
  margin-bottom: 20px;
  transition: background 0.4s ease;
}
.progress-line.done { background: var(--success); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .icon { font-size: 22px; }

/* Terms */
.terms-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
  margin-bottom: 24px;
  scroll-behavior: smooth;
}
.terms-box::-webkit-scrollbar { width: 5px; }
.terms-box::-webkit-scrollbar-track { background: transparent; }
.terms-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.terms-box h3 {
  color: var(--text);
  font-size: 14px;
  margin: 16px 0 8px;
  font-weight: 700;
}
.terms-box h3:first-child { margin-top: 0; }

.scroll-hint {
  text-align: center;
  font-size: 12px;
  color: var(--warn);
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.scroll-hint.hidden { display: none; }

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  margin-bottom: 20px;
}
.checkbox-row:hover { border-color: var(--accent); background: var(--accent-hover-bg); }
.checkbox-row input { display: none; }
.custom-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.checkbox-row input:checked + .custom-check {
  background: var(--accent);
  border-color: var(--accent);
}
.custom-check svg { opacity: 0; transition: opacity 0.15s; }
.checkbox-row input:checked + .custom-check svg { opacity: 1; }
.checkbox-label { font-size: 14px; font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.btn-success {
  background: linear-gradient(135deg, var(--success), #2dd4bf);
  color: #0f1117;
  box-shadow: 0 4px 20px rgba(52,211,153,0.25);
}
.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(52,211,153,0.35);
}
.btn-success:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Quiz */
.quiz-counter {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.quiz-question {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 24px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
}
.quiz-option:hover { border-color: var(--accent); background: var(--accent-hover-bg); }
.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-selected-bg);
}
.quiz-option.correct {
  border-color: var(--success) !important;
  background: rgba(52,211,153,0.1) !important;
}
.quiz-option.wrong {
  border-color: var(--error) !important;
  background: rgba(248,113,113,0.08) !important;
}
.quiz-option.disabled { pointer-events: none; }
.option-marker {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.quiz-option.selected .option-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.quiz-option.correct .option-marker {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.quiz-option.wrong .option-marker {
  border-color: var(--error);
  background: var(--error);
  color: #fff;
}

.quiz-feedback {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: cardIn 0.3s ease;
}
.quiz-feedback.correct {
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--success);
}
.quiz-feedback.wrong {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--error);
}

.quiz-result {
  text-align: center;
  padding: 20px 0;
}
.result-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.result-score {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 4px;
}
.result-score .total { color: var(--text-dim); font-weight: 400; font-size: 20px; }
.result-text {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 28px;
  line-height: 1.7;
}

/* Form */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dim);
}
.form-label .required { color: var(--error); margin-left: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: #4a4e64; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b8fa3' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
option { background: var(--surface); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}
.submit-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
  line-height: 1.7;
}

/* Email verification */
.verify-email-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.verify-email-input-row .form-input {
  flex: 1;
}
.verify-email-input-row .btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  padding: 13px 20px;
  font-size: 14px;
}
.verify-code-input {
  width: 100%;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 12px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.verify-code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.verify-code-input::placeholder {
  color: #4a4e64;
  letter-spacing: 6px;
  font-size: 18px;
}
.verify-message {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: cardIn 0.3s ease;
}
.verify-message.error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--error);
}
.verify-message.success {
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--success);
}
.verify-message.info {
  background: rgba(91,141,238,0.08);
  border: 1px solid rgba(91,141,238,0.2);
  color: var(--accent);
}
.verify-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}
.verify-link:hover { color: var(--accent); }
.verify-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}
.verify-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}
.form-input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .verify-email-input-row {
    flex-direction: column;
  }
  .verify-email-input-row .btn {
    width: 100%;
  }
  .verify-code-input {
    font-size: 22px;
    letter-spacing: 8px;
  }
}
