/* 무료진단 신청 — 상담 목록과 동일 컨테이너·슬레이트 톤 */

.ph-consult-write {
  --layout-max: 1080px;
  --radius: 12px;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #334155;
  --accent-hover: #0f172a;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  padding: 24px 0 48px;
}

/* 가로: style.css 헤더·푸터·상담 목록과 동일 1080px, 좌우 16px 안쪽 여백 */
main .ph-consult-write.container {
  align-self: stretch;
  width: 100%;
  max-width: min(var(--layout-max), calc(100% - 32px));
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.ph-consult-write .btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
}

.ph-consult-write .btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.ph-consult-write .btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.ph-consult-write .btn-ghost:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.ph-consult-write .page-header {
  margin-bottom: 24px;
}

.ph-consult-write .page-header-text h2 {
  font-size: 25px;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.ph-consult-write .page-header-text p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}

.ph-consult-write .consult-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 26px;
}

.ph-consult-write .form-row {
  margin-bottom: 18px;
}

.ph-consult-write .form-row label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}

.ph-consult-write .form-row .req {
  color: #b91c1c;
  font-weight: 700;
}

.ph-consult-write select,
.ph-consult-write input[type='text'],
.ph-consult-write textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.ph-consult-write select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ph-consult-write textarea {
  min-height: 100px;
  resize: vertical;
}

.ph-consult-write .region-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .ph-consult-write .region-row {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 900px) {
  .ph-consult-write .page-header {
    text-align: center;
  }
}

@media screen and (min-width: 901px) {
  .ph-consult-write .page-header-text {
    text-align: left;
  }
  .ph-consult-write .page-header {
    text-align: left;
  }
}

@media screen and (max-width: 768px) {
  .ph-consult-write {
    padding: 16px 0 40px;
  }
  .ph-consult-write .consult-form-card {
    padding: 18px 14px 22px;
  }
}

@media screen and (max-width: 480px) {
  .ph-consult-write .page-header-text h2 {
    font-size: 1.35rem;
  }
  .ph-consult-write .page-header-text p {
    font-size: 0.95rem;
  }
  .ph-consult-write .consult-form-card {
    padding: 16px 12px 20px;
  }
}

.ph-consult-write .photo-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px 0;
}

.ph-consult-write .photo-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .ph-consult-write .photo-slots {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .ph-consult-write .photo-slots {
    grid-template-columns: 1fr;
  }
}

.ph-consult-write .photo-slot {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafbfc;
  box-shadow: var(--shadow);
}

.ph-consult-write .photo-slot-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

/* 클릭 영역: 사진등록 / 미리보기 */
.ph-consult-write .photo-slot-dropzone {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 160px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ph-consult-write .photo-slot-dropzone:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.ph-consult-write .photo-slot-dropzone:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.ph-consult-write .photo-slot-inner {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ph-consult-write .photo-slot-placeholder {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}

.ph-consult-write .photo-slot-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  pointer-events: none;
}

/* 삭제: 미리보기 위 우측 상단, 드롭존보다 위 레이어 (hidden은 display:flex보다 우선) */
.ph-consult-write .photo-slot-remove[hidden] {
  display: none !important;
}

.ph-consult-write .photo-slot-remove:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ph-consult-write .photo-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 30;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.45);
}

.ph-consult-write .photo-slot-remove:hover {
  background: #b91c1c;
}

.ph-consult-write .photo-slot-remove:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 모바일: 카메라 / 갤러리 선택 모달 */
.ph-consult-write .photo-pick-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.ph-consult-write .photo-pick-modal[hidden] {
  display: none !important;
}

.ph-consult-write .photo-pick-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 0;
}

.ph-consult-write .photo-pick-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 18px 16px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .ph-consult-write .photo-pick-modal {
    align-items: center;
  }

  .ph-consult-write .photo-pick-modal-panel {
    border-radius: var(--radius);
  }
}

.ph-consult-write .photo-pick-modal-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

.ph-consult-write .photo-pick-opt,
.ph-consult-write .photo-pick-cancel {
  width: 100%;
  justify-content: center;
}

.ph-consult-write .submit-row {
  margin-top: 24px;
}

.ph-consult-write .submit-button {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
}

.ph-consult-write .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 접수 오버레이 */
.ph-consult-write .ai-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.ph-consult-write .ai-overlay-inner {
  background: var(--surface);
  padding: 28px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 90%;
}

.ph-consult-write .ai-overlay-inner p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.ph-consult-write .visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
