/* ============================================================
   感情の星座 — お問い合わせページ (contact.css)
   ============================================================ */

/* --- Page layout ------------------------------------------- */
#contact-main {
  position: relative;
  z-index: 20;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 100px;
}

/* --- Form wrap --------------------------------------------- */
#contact-form-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

#contact-form-wrap.fade-out {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}

/* --- Hero -------------------------------------------------- */
.contact-hero {
  text-align: center;
  margin-bottom: 44px;
}

.contact-eyebrow {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.contact-title {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.contact-subtitle {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* --- Card -------------------------------------------------- */
.contact-card {
  width: 100%;
  background: rgba(12, 18, 34, 0.68);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 44px 48px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Intro text -------------------------------------------- */
.contact-intro {
  font-size: 0.92rem;
  font-weight: 300;
  color: rgba(241, 241, 242, 0.75);
  line-height: 2;
  letter-spacing: 0.03em;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(241, 241, 242, 0.06);
}

/* --- Field ------------------------------------------------- */
.contact-field {
  margin-bottom: 32px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(241, 241, 242, 0.88);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.field-optional {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0.6;
  border: 1px solid rgba(241, 241, 242, 0.15);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

.field-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-base);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  outline: none;
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease;
  /* Ghost border fallback (design.md §4) */
  box-shadow: inset 0 0 0 1px rgba(241, 241, 242, 0.08);
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: rgba(241, 241, 242, 0.22);
}

.field-input:focus {
  background: rgba(255, 255, 255, 0.07);
  /* Soft glow instead of harsh border (design.md §4) */
  box-shadow:
    inset 0 0 0 1px rgba(220, 238, 248, 0.2),
    0 0 24px rgba(220, 238, 248, 0.07);
}

.field-input.error {
  box-shadow:
    inset 0 0 0 1px rgba(255, 180, 171, 0.3),
    0 0 20px rgba(255, 180, 171, 0.08);
}

.field-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.75;
}

/* --- Inline error ------------------------------------------ */
.field-error {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(255, 180, 171, 0.8);
  letter-spacing: 0.05em;
  margin-top: 7px;
  min-height: 1em;
  /* Soft pulse instead of sharp alert (design.md §6) */
  animation: none;
}

.field-error.visible {
  animation: error-glow 0.4s ease;
}

@keyframes error-glow {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* --- Submit ------------------------------------------------ */
.contact-submit-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-top: 8px;
}

.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 72px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(220, 238, 248, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(220, 238, 248, 0.18);
  font-family: var(--font-base);
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(220, 238, 248, 0.85);
  letter-spacing: 0.14em;
  cursor: pointer;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease,
    color 0.4s ease,
    transform 0.3s ease;
}

.contact-submit-btn:hover {
  background: rgba(220, 238, 248, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(220, 238, 248, 0.3),
    0 0 28px rgba(220, 238, 248, 0.12);
  color: rgba(220, 238, 248, 1);
  transform: translateY(-1px);
}

.contact-submit-btn:active {
  transform: translateY(0);
}

.contact-submit-btn:disabled,
.contact-submit-btn.sending {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   Success state
   ============================================================ */
#contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 60px;
  gap: 0;
  animation: card-rise 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#contact-success:not([hidden]) {
  display: flex;
}

.success-glow {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 238, 248, 0.18) 0%, transparent 70%);
  margin-bottom: 36px;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.12); opacity: 1; }
}

.success-eyebrow {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.success-main {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.success-sub {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  line-height: 1.9;
  margin-bottom: 44px;
}

.success-back {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(241, 241, 242, 0.18);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.success-back:hover {
  color: var(--text-primary);
  border-color: rgba(241, 241, 242, 0.5);
}

/* ============================================================
   Mobile (< 600px)
   ============================================================ */
@media (max-width: 600px) {
  #contact-main {
    padding: 100px 16px 80px;
  }

  .contact-card {
    padding: 32px 24px 28px;
  }

  .contact-title {
    font-size: 1.7rem;
  }

  .contact-submit-btn {
    padding: 13px 48px;
    width: 100%;
  }
}
