/* ========== 기본 설정 ========== */

:root {
  --pleo-main: #180202;
  --pleo-main-soft: #ffebee;
  --pleo-accent: #ff9800;
  --bg-body: #f5f5f7;
  --text-main: #222;
  --text-muted: #666;
  --border-soft: #e0e0e0;
  --radius-card: 16px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
}

/* ========== 헤더 / 네비게이션 ========== */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffffcc;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--pleo-main);
  text-decoration: none;
}

.nav nav a {
  margin-left: 16px;
  text-decoration: none;
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav nav a:hover {
  background: var(--pleo-main-soft);
  color: var(--pleo-main);
}

/* ========== 레이아웃 ========== */

.container {
  max-width: 960px;
  margin: 32px auto 80px;
  padding: 0 16px;
}

h1 {
  font-size: 28px;
  margin: 8px 0 8px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.lead {
  margin: 4px 0 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========== 폼 카드 ========== */

.estimate-form {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.form-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.field-row label {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-main);
}

.field-full {
  flex: 0 0 100%;
}

label span.required {
  color: var(--pleo-main);
  margin-left: 2px;
}

/* ========== 인풋 / 셀렉트 / 텍스트에어리어 ========== */

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  background: #fcfcff;
}

input::placeholder,
textarea::placeholder {
  color: #b0b0b0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pleo-main);
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  padding: 4px 0;
  background: transparent;
}

/* 연락처 묶음 */

.contact-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-fieldset input {
  flex: 1 1 0;
}

/* 힌트 텍스트 */

.hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== 액션 버튼 ========== */

.form-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

button[type="submit"],
button,
.button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--pleo-main);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button[type="submit"]:hover,
button:hover {
  background: #d62828;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(229, 57, 53, 0.32);
}

button[type="submit"]:active,
button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* ========== 모달 ========== */

#doneModal {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 16, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#doneModal[hidden] {
  display: none;
}

.modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 22px 18px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-soft);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
}

#estimateSummary {
  margin: 8px 0 16px;
  padding: 10px 12px;
  background: #fafafa;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
}

/* ========== 푸터 ========== */

.footer {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding: 16px 24px 20px;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  background: #fff;
}

/* ========== 기타 페이지 공용 스타일 (case, contact 등) ========== */

main.page {
  max-width: 960px;
  margin: 32px auto 80px;
  padding: 0 16px;
}

.card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 20px 24px;
}

/* ========== 반응형 ========== */

@media (max-width: 768px) {
  .nav {
    padding: 0 16px;
  }

  .container {
    margin-top: 20px;
  }

  .estimate-form {
    padding: 18px 16px 22px;
  }

  .field-row {
    flex-direction: column;
  }

  .form-actions {
    justify-content: stretch;
  }

  button[type="submit"] {
    width: 100%;
  }
}

.form-section textarea {
  width: 100%;
  box-sizing: border-box;   /* 패딩 포함해 폭 오버플로우 방지 */
  min-height: 140px;        /* 필요시 조절 */
}

/* 1) hidden 이 붙으면 무조건 안 보이게 */
#loadingModal[hidden],
#doneModal[hidden] {
  display: none !important;
}

/* 2) 실제 보여줄 때 사용할 스타일 */
#loadingModal,
#doneModal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.25);
}

/* 내부 카드 스타일은 그대로 */
#loadingModal .modal {
  background: #fff;
  padding: 24px 32px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}


/* 전체 배경 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  z-index: 9999;
}

/* 모달 박스 */
.modal-box {
  background: #fff;
  width: 90%;
  max-width: 420px;
  padding: 30px 25px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 제목 */
.modal-box h2 {
  margin-bottom: 20px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #222;
}

/* 견적 박스 */
.estimate-box {
  background: #fafafa;
  border: 1px solid #eee;
  padding: 18px 15px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.estimate-box p {
  margin: 4px 0;
  font-size: 0.95rem;
  color: #444;
}

.sub-info {
  font-size: 0.85rem;
  color: #737373;
}

/* 카카오 링크 */
.kakao-link {
  display: inline-block;
  margin-bottom: 15px;
  color: #3A7AFE;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

/* 닫기 버튼 */
.close-btn {
  background: none;
  border: 1px solid #ddd;
  color: #333;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}


/* 푸터 텍스트 */
.footer-text {
  margin-top: 15px;
  font-size: 0.8rem;
  color: #999;
}

.kakao-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fee500;
  color: #000;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
  transition: all 0.2s ease;
}

.kakao-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
}

.kakao-btn:hover {
  background: #ffd800;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgb(0 0 0 / 18%);
}

.notice {
  font-size: 0.85rem;
  color: #777;
  margin-top: 12px;
  line-height: 1.5;
}
