/* =========================================================
   Souganji Renewal - contact pages
========================================================= */

.contact-page {
  width: 100%;
  margin-bottom: 50px;
  padding: 0;
}

.contact-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding-top: 50px;
}

.contact-page .page-content {
  margin-bottom: 24px;
  color: var(--sg-text);
}

.contact-form__error-box {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  color: #991b1b;
  box-shadow: 0 8px 20px rgba(127,29,29,.04);
}

.contact-form__error-box p {
  margin: 0;
  font-weight: 600;
}

.contact-form {
  padding: 32px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.contact-form__row { margin-bottom: 24px; }
.contact-form__row:last-child { margin-bottom: 0; }

.contact-form label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #111827;
}

.contact-form .required {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
  vertical-align: middle;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea,
.contact-form__row select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 1rem;
  line-height: 1.6;
}

.contact-form textarea {
  min-height: 180px;
  resize: vertical;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus,
.contact-form__row select:focus {
  outline: none;
  border-color: var(--sg-gold);
  box-shadow: 0 0 0 3px rgba(185,155,98,.16);
}

.contact-form__row select {
  min-height: 48px;
  padding: 10px 44px 10px 14px;
  border-color: var(--sg-line);
  border-radius: 0;
  color: var(--sg-text);
  font-size: 15px;
  line-height: 1.6;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--sg-brown) 50%),
    linear-gradient(135deg, var(--sg-brown) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.contact-form__row select:hover { border-color: #cdbb97; }
.contact-form__row select:invalid { color: var(--sg-muted); }
.contact-form__row select::-ms-expand { display: none; }

.contact-form__error {
  margin: 8px 0 0;
  font-size: .92rem;
  font-weight: 600;
  color: #dc2626;
}

.contact-form__actions,
.contact-confirm__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.contact-btn {
  display: inline-block;
  min-width: 180px;
  padding: 14px 24px;
  border: 1px solid var(--sg-brown);
  border-radius: 999px;
  background: var(--sg-brown);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(80,67,42,.14);
  transition: transform .15s ease, background .2s ease, color .2s ease;
}

.contact-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  color: var(--sg-brown);
}

.contact-btn--back {
  color: var(--sg-ink);
  background: #fff;
  border-color: var(--sg-line);
  box-shadow: none;
}

.contact-btn--back:hover {
  background: #f8f4ec;
  color: var(--sg-ink);
}

.contact-confirm {
  padding: 32px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.contact-confirm__table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.contact-confirm__table th,
.contact-confirm__table td {
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  line-height: 1.75;
}

.contact-confirm__table tr:last-child th,
.contact-confirm__table tr:last-child td { border-bottom: 0; }

.contact-confirm__table th {
  width: 28%;
  min-width: 140px;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}

.contact-confirm__table td {
  background: #fff;
  color: #374151;
  word-break: break-word;
}

.contact-confirm__form { margin: 0; }

.contact-thanks {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--sg-line);
  box-shadow: 0 10px 26px rgba(80,67,42,.05);
}

.contact-thanks p:last-child { margin-bottom: 0; }

/* Privacy */
.contact-form__privacy {
  margin-top: 24px;
  padding: 22px 24px;
  background: #fbf7ef;
  border: 1px solid var(--sg-line);
}

.contact-form__privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--sg-text);
  font-size: 15px;
  line-height: 1.8;
  cursor: pointer;
}

.contact-form__privacy-check input {
  margin-top: .45em;
  flex: 0 0 auto;
}

.contact-form__privacy-open {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sg-brown);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.contact-form__privacy-open:hover { color: var(--sg-gold); }

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.privacy-modal.is-open { display: block; }

.privacy-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(24,20,14,.72);
}

.privacy-modal__content {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(calc(100% - 40px), 760px);
  max-height: calc(100vh - 60px);
  transform: translate(-50%, -50%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--sg-line);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  overflow: auto;
}

.privacy-modal__close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--sg-line);
  border-radius: 50%;
  background: #fff;
  color: var(--sg-ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.privacy-modal h2 {
  margin: 0 48px 24px 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--sg-line);
  color: var(--sg-ink);
  font-family: var(--sg-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .08em;
}

.privacy-modal__body h3 {
  margin: 26px 0 8px;
  color: var(--sg-ink);
  font-size: 17px;
  line-height: 1.7;
}

.privacy-modal__body p {
  margin: 0 0 1.2em;
  color: var(--sg-text);
  font-size: 15px;
  line-height: 1.9;
}

.privacy-modal__actions {
  margin-top: 28px;
  text-align: center;
}

body.privacy-modal-open { overflow: hidden; }

.contact-page p:empty,
.contact-confirm p:empty { display: none; }

@media screen and (max-width: 768px) {
  .contact-form,
  .contact-confirm {
    padding: 24px;
    border-radius: 18px;
  }

  .contact-form__actions,
  .contact-confirm__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-btn {
    width: 100%;
    min-width: 0;
  }

  .contact-confirm__table,
  .contact-confirm__table tbody,
  .contact-confirm__table tr,
  .contact-confirm__table th,
  .contact-confirm__table td {
    display: block;
    width: 100%;
  }

  .contact-confirm__table {
    border: 0;
    background: transparent;
  }

  .contact-confirm__table tr {
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15,23,42,.03);
  }

  .contact-confirm__table th,
  .contact-confirm__table td {
    border: 0;
    padding: 14px 16px;
  }

  .contact-confirm__table th {
    min-width: 0;
    border-bottom: 1px solid #e5e7eb;
  }
}

@media screen and (max-width: 640px) {
  .contact-wrap {
    max-width: 100%;
    padding-top: 0;
  }

  .contact-form,
  .contact-confirm,
  .contact-thanks {
    padding: 20px;
  }

  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form input[type="tel"],
  .contact-form textarea {
    padding: 12px 14px;
  }

  .contact-form__row select {
    min-height: 46px;
    font-size: 16px;
  }

  .privacy-modal__content {
    width: min(calc(100% - 24px), 760px);
    padding: 26px 22px;
  }

  .privacy-modal h2 { font-size: 23px; }
}
