/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #0f0f0f;
  --gray-900: #1a1a1a;
  --gray-700: #404040;
  --gray-500: #737373;
  --gray-300: #d4d4d4;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --yellow: #f5c518;
  --yellow-light: #fef3c7;
  --yellow-dark: #d4a017;
  --red: #dc2626;
  --green: #16a34a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.06);
}

body {
  font-family: "Hiragino Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-900);
  background: linear-gradient(168deg, var(--white) 0%, var(--yellow-light) 50%, var(--yellow) 100%);
  min-height: 100vh;
}

/* ── Layout ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--black);
}

.tagline {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ── Card ── */
#form-section {
  position: relative;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.database-spotlight {
  position: relative;
  display: grid;
  gap: 6px;
  width: min(100%, 290px);
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff4f4 0%, #ffffff 100%);
  border: 2px solid var(--black);
  box-shadow: 6px 6px 0 rgba(15, 15, 15, 0.96);
  text-decoration: none;
  color: var(--gray-900);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.database-spotlight-floating {
  position: absolute;
  top: 0;
  right: -318px;
  z-index: 3;
}

.database-spotlight:hover {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 8px 8px 0 rgba(15, 15, 15, 0.96);
  background: linear-gradient(180deg, #ffe4e4 0%, #fff8f8 100%);
}

.database-spotlight:active {
  transform: translateY(0);
}

.database-spotlight-label {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dc2626;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}

.database-spotlight-title {
  font-size: 18px;
  line-height: 1.4;
  color: var(--black);
}

.database-spotlight-desc {
  font-size: 12px;
  line-height: 1.65;
  color: var(--gray-700);
}

.database-spotlight-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
}

.form-card-title {
  text-align: center;
}

.card-description {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
  line-height: 1.8;
}

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

.form-row {
  display: flex;
  gap: 16px;
}

.form-group-half {
  flex: 1;
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.required {
  color: var(--red);
}

.input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus {
  outline: none;
  border-color: var(--yellow-dark);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.2);
}

.input.has-error {
  border-color: var(--red);
}

.input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.textarea {
  resize: vertical;
  min-height: 120px;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.error-message {
  font-size: 13px;
  color: var(--red);
  margin-top: 4px;
  min-height: 0;
}

.error-message:empty {
  display: none;
}

/* ── Honeypot ── */
.hp-field {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── File Upload ── */
.file-upload {
  position: relative;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-upload:hover,
.file-upload.dragover {
  border-color: var(--yellow-dark);
  background: var(--yellow-light);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-icon {
  width: 32px;
  height: 32px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.file-upload-text {
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 500;
}

.file-upload-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.file-name {
  font-size: 13px;
  color: var(--green);
  margin-top: 8px;
  font-weight: 500;
}

.file-name:empty {
  display: none;
}

/* ── Submit Button ── */
.submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: var(--black);
  background: var(--yellow);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--yellow-dark);
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Loading Spinner ── */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

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

/* ── Complete Section ── */
.complete-card {
  text-align: center;
  padding: 48px 32px;
}

.complete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--green);
}

.complete-icon svg {
  width: 100%;
  height: 100%;
}

.complete-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 16px;
}

.complete-message {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 2;
  margin-bottom: 20px;
}

.complete-time {
  font-weight: 600;
  color: var(--yellow-dark);
}

.complete-note {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.back-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.back-btn:hover {
  background: var(--gray-300);
}

/* ── Privacy Note ── */
.privacy-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 16px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: auto;
  padding-top: 40px;
}

.sponsor-notice {
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--gray-50, #f8f8f8);
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-600, #525252);
  line-height: 1.7;
}

.sponsor-notice a {
  color: var(--primary, #d4a017);
  font-weight: 600;
  text-decoration: none;
}

.sponsor-notice a:hover {
  text-decoration: underline;
}

/* ── Quota Badge ── */
.quota-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 20px;
  padding: 10px 16px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--gray-700);
  justify-content: center;
}

.quota-badge.low {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.quota-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.quota-badge.low .quota-icon {
  background: #ea580c;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.quota-text strong {
  color: var(--black);
  font-size: 15px;
  font-weight: 700;
  margin: 0 2px;
}

.quota-badge.low .quota-text strong {
  color: #9a3412;
}

/* ── Closed (店じまい) ── */
.closed-card {
  text-align: center;
  padding: 56px 32px 48px;
  background: linear-gradient(180deg, #fff7ed 0%, #fef3c7 100%);
  border: 2px solid #fcd34d;
  position: relative;
  overflow: hidden;
}

.closed-card::before,
.closed-card::after {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #dc2626 0,
    #dc2626 12px,
    #fff 12px,
    #fff 24px
  );
  opacity: 0.15;
}
.closed-card::before { left: 0; }
.closed-card::after  { right: 0; }

.closed-lantern {
  width: 100px;
  margin: 0 auto 28px;
  animation: sway 3s ease-in-out infinite;
  transform-origin: top center;
}

.lantern-body {
  width: 100px;
  height: 120px;
  background: radial-gradient(ellipse at center, #fca5a5 0%, #dc2626 60%, #991b1b 100%);
  border-radius: 50% / 40%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.2),
    0 6px 16px rgba(220, 38, 38, 0.3);
}

.lantern-stripe {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
}

.lantern-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  padding: 4px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  font-family: "Hiragino Mincho ProN", serif;
}

.lantern-tassel {
  width: 4px;
  height: 24px;
  background: #78350f;
  margin: 0 auto;
}
.lantern-tassel::after {
  content: "";
  display: block;
  width: 30px;
  height: 30px;
  margin: 4px auto 0;
  background: repeating-linear-gradient(
    0deg,
    #fbbf24 0,
    #fbbf24 2px,
    #78350f 2px,
    #78350f 4px
  );
  border-radius: 0 0 4px 4px;
}

@keyframes sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.closed-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 16px;
  font-family: "Hiragino Mincho ProN", serif;
  letter-spacing: 2px;
}

.closed-message {
  font-size: 16px;
  color: var(--gray-900);
  line-height: 2;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.closed-highlight {
  display: inline-block;
  background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%);
  padding: 0 4px;
  font-size: 18px;
  font-weight: 700;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

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

.closed-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.closed-clock {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 32px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.clock-label {
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 1px;
}

.clock-countdown {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  font-family: "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

/* ── About Link Card ── */
.about-link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  margin: 20px auto 0;
  padding: 18px 22px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  text-decoration: none;
  color: var(--gray-900);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s, background 0.2s;
  position: relative;
}

.about-link-card:hover {
  border-color: var(--yellow-dark);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(90deg, var(--white) 0%, #fffbeb 100%);
  transform: translateY(-1px);
}

.about-link-card:active {
  transform: translateY(0);
}

.about-link-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow-light);
  border-radius: 50%;
  color: var(--yellow-dark);
}

/* サンプルカードのアイコンは緑系で差別化（「レポート/書類」の意味性を強調） */
.sample-link-card .about-link-icon {
  background: #dcfce7;
  color: #15803d;
}

.database-link-card .about-link-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.about-link-icon svg {
  width: 22px;
  height: 22px;
}

.about-link-body {
  flex: 1;
  min-width: 0;
}

.about-link-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 3px;
  line-height: 1.4;
}

.about-link-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.5;
}

.about-link-arrow {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--gray-500);
  font-weight: 300;
  transition: transform 0.2s, color 0.15s;
}

.about-link-card:hover .about-link-arrow {
  color: var(--yellow-dark);
  transform: translateX(3px);
}

@media (max-width: 1240px) {
  .database-spotlight-floating {
    position: static;
    display: block;
    margin: 0 0 18px auto;
  }
}

@media (max-width: 600px) {
  .database-spotlight {
    width: 100%;
    padding: 14px 14px 15px;
    box-shadow: 4px 4px 0 rgba(15, 15, 15, 0.96);
  }

  .database-spotlight-floating {
    margin-bottom: 16px;
  }

  .database-spotlight-title {
    font-size: 16px;
  }

  .about-link-card {
    padding: 14px 16px;
    gap: 12px;
  }
  .about-link-icon {
    width: 36px;
    height: 36px;
  }
  .about-link-title {
    font-size: 14px;
  }
  .about-link-desc {
    font-size: 11px;
  }
}

/* ── Utilities ── */
.hidden {
  display: none !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .container {
    padding: 24px 16px;
  }

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

  .card-title {
    font-size: 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .logo {
    font-size: 24px;
  }
}
