/* =========================================================
   Yeosunet AI Estimate
   Customer Estimate Form
========================================================= */

.ysae-estimate-wrap {
  width: 100%;
  max-width: 820px;
  margin: 40px auto;
  padding: 0;
  color: #1d2327;
  font-family: inherit;
  box-sizing: border-box;
}

.ysae-estimate-wrap *,
.ysae-estimate-wrap *::before,
.ysae-estimate-wrap *::after {
  box-sizing: border-box;
}

/* =========================================================
   HEADER
========================================================= */

.ysae-estimate-header {
  margin-bottom: 24px;
  padding: 34px 36px;
  border-radius: 18px;
  background: #172033;
  color: #fff;
}

.ysae-estimate-header h2 {
  margin: 0 0 10px;
  padding: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
}

.ysae-estimate-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.7;
}

/* =========================================================
   FORM
========================================================= */

.ysae-estimate-form {
  padding: 36px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.07);
}

.ysae-field {
  margin-bottom: 28px;
}

.ysae-field > label {
  display: block;
  margin-bottom: 10px;
  color: #111827;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

.ysae-field > label span {
  margin-left: 3px;
  color: #dc2626;
}

/* =========================================================
   INPUTS
========================================================= */

.ysae-estimate-form input[type="text"],
.ysae-estimate-form input[type="tel"],
.ysae-estimate-form input[type="email"],
.ysae-estimate-form input[type="number"],
.ysae-estimate-form input[type="date"],
.ysae-estimate-form input[type="time"],
.ysae-estimate-form select,
.ysae-estimate-form textarea {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 15px;
  border: 1px solid #d7dce3;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #111827;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ysae-estimate-form textarea {
  min-height: 120px;
  resize: vertical;
}

.ysae-estimate-form input:focus,
.ysae-estimate-form select:focus,
.ysae-estimate-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =========================================================
   NUMBER + UNIT
========================================================= */

.ysae-input-unit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ysae-input-unit input {
  flex: 1;
}

.ysae-input-unit > span {
  flex: 0 0 auto;
  min-width: 34px;
  color: #4b5563;
  font-size: 15px;
  font-weight: 600;
}

/* =========================================================
   RADIO / CHECKBOX
========================================================= */

.ysae-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ysae-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.ysae-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ysae-choice > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #d7dce3;
  border-radius: 9px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.ysae-choice:hover > span {
  border-color: #94a3b8;
  background: #f8fafc;
}

.ysae-choice input:checked + span {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.ysae-choice input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* =========================================================
   CUSTOMER
========================================================= */

.ysae-customer-section {
  margin-top: 38px;
  padding-top: 30px;
  border-top: 1px solid #e5e7eb;
}

.ysae-customer-section h3 {
  margin: 0 0 26px;
  color: #111827;
  font-size: 21px;
  font-weight: 700;
}

/* =========================================================
   SUBMIT
========================================================= */

.ysae-submit-wrap {
  margin-top: 34px;
}

.ysae-submit-wrap button {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  border: 0;
  border-radius: 11px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

.ysae-submit-wrap button:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.ysae-submit-wrap button:active {
  transform: translateY(0);
}

/* =========================================================
   ALERT
========================================================= */

.ysae-alert {
  margin-bottom: 20px;
  padding: 15px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.ysae-alert-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* =========================================================
   RESULT
========================================================= */

.ysae-result {
  margin-bottom: 25px;
  padding: 34px 36px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #f8fbff;
}

.ysae-result-title {
  margin-bottom: 6px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
}

.ysae-result-service {
  margin-bottom: 20px;
  color: #111827;
  font-size: 22px;
  font-weight: 700;
}

.ysae-result-price {
  margin-bottom: 12px;
  color: #111827;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -1px;
}

.ysae-result-price span {
  margin: 0 6px;
  color: #64748b;
  font-weight: 400;
}

.ysae-result-base {
  margin-bottom: 24px;
  color: #64748b;
  font-size: 14px;
}

.ysae-result-base strong {
  margin-left: 6px;
  color: #111827;
}

/* =========================================================
   RESULT ITEMS
========================================================= */

.ysae-result-items {
  overflow: hidden;
  margin-top: 20px;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
}

.ysae-result-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 2px;
  border-bottom: 1px solid #e5edf8;
  color: #475569;
  font-size: 14px;
}

.ysae-result-item:last-child {
  border-bottom: 0;
}

.ysae-result-item strong {
  flex: 0 0 auto;
  color: #111827;
}

/* =========================================================
   ESTIMATE NUMBER
========================================================= */

.ysae-estimate-number {
  margin-top: 20px;
  color: #64748b;
  font-size: 13px;
}

.ysae-estimate-number strong {
  color: #334155;
}

/* =========================================================
   NOTICE
========================================================= */

.ysae-result-notice {
  margin: 18px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

/* =========================================================
   GENERAL MESSAGE
========================================================= */

.ysae-message {
  max-width: 820px;
  margin: 40px auto;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 768px) {
  .ysae-estimate-wrap {
    margin: 24px auto;
  }

  .ysae-estimate-header {
    padding: 28px 25px;
    border-radius: 14px;
  }

  .ysae-estimate-header h2 {
    font-size: 25px;
  }

  .ysae-estimate-form {
    padding: 26px 24px;
    border-radius: 14px;
  }

  .ysae-result {
    padding: 28px 24px;
    border-radius: 14px;
  }

  .ysae-result-price {
    font-size: 27px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 520px) {
  .ysae-estimate-wrap {
    margin: 15px auto;
  }

  .ysae-estimate-header {
    padding: 24px 20px;
  }

  .ysae-estimate-header h2 {
    font-size: 23px;
  }

  .ysae-estimate-header p {
    font-size: 14px;
  }

  .ysae-estimate-form {
    padding: 24px 18px;
  }

  .ysae-field {
    margin-bottom: 23px;
  }

  .ysae-choice-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysae-choice {
    width: 100%;
  }

  .ysae-choice > span {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ysae-result {
    padding: 25px 20px;
  }

  .ysae-result-price {
    font-size: 24px;
  }

  .ysae-result-item {
    gap: 10px;
  }
}

/* =========================================================
   AJAX QUESTIONS
========================================================= */

#ysae-questions-wrap {
  position: relative;
  transition: opacity 0.2s ease;
}

#ysae-questions-wrap.ysae-loading {
  min-height: 100px;
  opacity: 0.45;
  pointer-events: none;
}

#ysae-questions-wrap.ysae-loading::after {
  content: "질문을 불러오는 중...";
  position: absolute;
  top: 20px;
  left: 50%;
  padding: 10px 16px;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
}

.ysae-no-questions {
  margin-bottom: 28px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

/* =========================================================
   CONSULT ESTIMATE
========================================================= */

.ysae-consult-result {
  margin: 22px 0;
  padding: 24px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.ysae-consult-result strong {
  display: block;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: 20px;
  line-height: 1.5;
}

.ysae-consult-result p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

/* =========================================================
   IMAGE UPLOAD
========================================================= */

.ysae-image-upload {
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.ysae-image-upload input[type="file"] {
  display: block;
  width: 100%;
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.ysae-image-upload input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 9px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
}

.ysae-image-upload input[type="file"]::file-selector-button:hover {
  background: #f1f5f9;
}

.ysae-upload-help {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

/* =========================================================
   IMAGE PREVIEW
========================================================= */

.ysae-image-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ysae-preview-item {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}

.ysae-preview-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.ysae-preview-name {
  overflow: hidden;
  padding: 7px;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .ysae-image-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .ysae-image-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   RESULT - VISIT BOOKING BUTTON
========================================================= */

.ysae-result-actions {
    margin-top: 24px;
    margin-bottom: 24px;
}

.ysae-visit-booking-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 14px 24px;
    border-radius: 11px;
    background: #111827;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    transition:
        transform .2s ease,
        opacity .2s ease,
        box-shadow .2s ease;
}

.ysae-visit-booking-button:hover {
    color: #ffffff !important;
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, .15);
}

@media (max-width: 767px) {

    .ysae-result-actions {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .ysae-visit-booking-button {
        min-height: 54px;
        font-size: 15px;
    }
}
