/* ================================================================
   銭湯ギフトセット お申し込みフォーム - スタイルシート
   ================================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', 'Yu Gothic', 'メイリオ', Meiryo, sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: #1a56db;
  text-decoration: underline;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Container ---- */
.form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ---- FAX Link ---- */
.fax-link {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  background: #e8f0fe;
  border-radius: 4px;
}

.fax-link a {
  color: #1a56db;
  font-size: 0.9rem;
}

/* ---- Form Title ---- */
.form-title {
  text-align: center;
  background: #1a237e;
  color: #fff;
  padding: 14px 20px;
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 30px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

/* ---- Section ---- */
.form-section {
  margin-bottom: 30px;
}

.section-heading {
  font-size: 0.95rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
  padding-left: 4px;
}

.section-heading::before {
  content: '▼';
  color: #1a237e;
  margin-right: 4px;
}

/* ---- Form Table ---- */
.form-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ccc;
  background: #fff;
}

.form-table tr {
  border-bottom: 1px solid #ddd;
}

.form-table tr:last-child {
  border-bottom: none;
}

.form-table th,
.form-table td {
  padding: 14px 16px;
  vertical-align: top;
  font-size: 0.9rem;
}

.form-table th {
  background: #eef2f7;
  width: 160px;
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
}

.form-table td {
  background: #fff;
}

/* Required Badge */
.required {
  display: inline-block;
  background: #c62828;
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: normal;
}

/* ---- Field Layout ---- */
.field-group {
  margin-bottom: 10px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 4px;
}

.field-label::before {
  content: '▼';
  color: #1a237e;
  margin-right: 3px;
  font-size: 0.78rem;
}

.inline-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-fields label {
  font-size: 0.85rem;
  color: #555;
  white-space: nowrap;
}

/* ---- Input Styles ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #1a56db;
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* Size variants */
.input-sm {
  width: 100px;
}

.input-md {
  width: 180px;
}

.input-lg {
  width: 100%;
  max-width: 400px;
}

.input-full {
  width: 100%;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

select {
  cursor: pointer;
  min-width: 80px;
}

/* Zip code */
.zip-fields {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zip-fields span {
  font-size: 0.9rem;
  color: #555;
}

.input-zip {
  width: 80px;
}

/* ---- Delivery Date ---- */
.delivery-section {
  margin-bottom: 20px;
}

.delivery-note {
  font-size: 0.82rem;
  color: #666;
  margin-top: 2px;
}

.delivery-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.delivery-fields select {
  min-width: 70px;
}

.delivery-fields span {
  font-size: 0.9rem;
  color: #555;
}

/* ---- Message Section ---- */
.message-section {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.message-section .message-input {
  flex: 1;
}

.message-section .message-card {
  flex-shrink: 0;
  width: 160px;
}

.message-card img {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.message-note {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 6px;
}

/* ---- Privacy Policy ---- */
.privacy-section {
  margin: 30px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
}

.privacy-section label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.privacy-section input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1a237e;
  cursor: pointer;
}

.privacy-section a {
  font-size: 0.9rem;
}

/* ---- Error Display ---- */
.field-error {
  display: none;
  color: #c62828;
  font-size: 0.78rem;
  margin-top: 4px;
  padding-left: 2px;
}

.field-error.visible {
  display: block;
}

input.has-error,
textarea.has-error,
select.has-error {
  border-color: #c62828 !important;
  background: #fff5f5 !important;
}

.form-error-summary {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 20px;
  color: #991b1b;
  font-size: 0.88rem;
}

.form-error-summary.visible {
  display: block;
}

.form-error-summary ul {
  margin: 6px 0 0 18px;
}

/* ---- Buttons ---- */
.btn-area {
  text-align: center;
  margin-top: 30px;
}

.btn-submit,
.btn-back,
.btn-edit {
  display: inline-block;
  padding: 14px 50px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  border: 2px solid #1a237e;
}

.btn-submit {
  background: #1a237e;
  color: #fff;
}

.btn-submit:hover {
  background: #0d1652;
}

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

.btn-back,
.btn-edit {
  background: #fff;
  color: #1a237e;
  margin-right: 12px;
}

.btn-back:hover,
.btn-edit:hover {
  background: #eef2f7;
}

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

/* ---- Confirm View ---- */
.confirm-view {
  display: none;
}

.confirm-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ccc;
  background: #fff;
  margin-bottom: 20px;
}

.confirm-table tr {
  border-bottom: 1px solid #ddd;
}

.confirm-table th,
.confirm-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  vertical-align: top;
}

.confirm-table th {
  background: #eef2f7;
  width: 160px;
  text-align: left;
  font-weight: bold;
}

.confirm-table td {
  background: #fff;
}

/* ---- Thanks View ---- */
.thanks-view {
  display: none;
}

.thanks-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 40px 30px;
  text-align: center;
  margin-top: 20px;
}

.thanks-box h2 {
  font-size: 1.2rem;
  color: #1a237e;
  margin-bottom: 16px;
}

.thanks-box p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: #555;
}

/* ---- Sending Overlay ---- */
.sending-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.sending-overlay.visible {
  display: flex;
}

.sending-spinner {
  background: #fff;
  border-radius: 10px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sending-spinner::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 4px solid #ddd;
  border-top-color: #1a237e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.sending-spinner p {
  font-size: 0.95rem;
  color: #333;
}

/* ---- Honeypot ---- */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ================================================================
   Responsive
   ================================================================ */

@media screen and (max-width: 768px) {
  .form-wrapper {
    padding: 12px 10px 40px;
  }

  .form-title {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .form-table,
  .form-table thead,
  .form-table tbody,
  .form-table tr,
  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
  }

  .form-table th {
    padding: 10px 12px 4px;
    background: #e3e8ef;
  }

  .form-table td {
    padding: 6px 12px 14px;
  }

  .confirm-table,
  .confirm-table thead,
  .confirm-table tbody,
  .confirm-table tr,
  .confirm-table th,
  .confirm-table td {
    display: block;
    width: 100%;
  }

  .confirm-table th {
    padding: 10px 12px 4px;
    background: #e3e8ef;
  }

  .confirm-table td {
    padding: 6px 12px 14px;
  }

  .input-lg {
    max-width: 100%;
  }

  .inline-fields {
    gap: 4px;
  }

  .input-md {
    width: 140px;
  }

  .message-section {
    flex-direction: column;
  }

  .message-card {
    width: 140px !important;
    margin: 0 auto;
  }

  .btn-submit,
  .btn-back,
  .btn-edit {
    padding: 12px 30px;
    font-size: 0.92rem;
  }

  .btn-back,
  .btn-edit {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .btn-area {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0;
  }

  .privacy-section {
    padding: 14px;
  }

  .thanks-box {
    padding: 30px 16px;
  }
}

@media screen and (max-width: 480px) {
  .form-title {
    font-size: 0.92rem;
    padding: 10px 10px;
  }

  .input-sm {
    width: 80px;
  }

  .input-md {
    width: 120px;
  }

  .delivery-fields select {
    min-width: 60px;
  }
}
