/* 리드 캡처 폼 기본 스타일 - lead-form-base.css */

/* 탭 스타일링 (멀티 도장 지원) */
.school-tabs {
  display: flex;
  margin: 0 20px 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  button {
    border-style: none !important;
    /* background: var(--leadform-primary-color, #c02a1e) !important; */
    background: none !important;
  }
}

.tab-button {
  flex: 1;
  padding: 12px 4px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
  text-align: center;
}

.tab-button:hover {
  color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
  color: currentColor;
  font-weight: 600;
  background: var(--leadform-primary-color, #c02a1e) !important;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
}
/* body {
  background-color: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  padding: 20px;
} */

/* 기존 단일 폼 지원 (하위 호환성) */
body .elementor-widget-container:has(#leadFormContainer),
body .elementor-widget-shortcode:has(#leadFormContainer) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 다중 폼 지원 - 클래스 기반 선택자 */
body .elementor-widget-container:has(.lead-form-wrapper),
body .elementor-widget-shortcode:has(.lead-form-wrapper) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Elementor 요소 - 기존 */
body .elementor-element:has(#leadFormContainer) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* Elementor 요소 - 다중 폼 지원 */
body .elementor-element:has(.lead-form-wrapper) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* Elementor 섹션 및 컬럼 - 기존 */
body .elementor-section:has(#leadFormContainer),
body .elementor-column:has(#leadFormContainer),
body .elementor-inner:has(#leadFormContainer) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* Elementor 섹션 및 컬럼 - 다중 폼 지원 */
body .elementor-section:has(.lead-form-wrapper),
body .elementor-column:has(.lead-form-wrapper),
body .elementor-inner:has(.lead-form-wrapper) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* 더 구체적인 선택자 - 기존 */
html body .elementor .elementor-element:has(#leadFormContainer) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* 더 구체적인 선택자 - 다중 폼 지원 */
html body .elementor .elementor-element:has(.lead-form-wrapper) {
  background: var(--leadform-page-background, #000) !important;
  background-color: var(--leadform-page-background, #000) !important;
}

/* 모든 상위 요소에 적용 - 기존 */
#leadFormContainer {
  background: var(--leadform-page-background, #000);
}

/* 모든 상위 요소에 적용 - 다중 폼 지원 */
.lead-form-wrapper {
  background: var(--leadform-page-background, #000);
}

#leadFormContainer * {
  box-sizing: border-box;
}

/* 전체 컨테이너 가운데 정렬 */
.lead-form-container {
  max-width: 600px;
  margin: 0 auto;
  /* padding: 20px; */
  position: relative;
}

/* 폼 제목 스타일 */
.lead-form-container .form-title {
  text-align: center;
  margin: 20px 0;
  font-size: 32px;
  font-weight: bold;
  line-height: 1.2;
  font-family: Arial, sans-serif;
}

/* 폼 컨테이너 */
.lead-capture-form {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  border-radius: var(--leadform-border-radius, 10px);
  font-family: Arial, sans-serif;
  color: var(--leadform-text-color, #fff);
  background-color: var(--leadform-background, #000);
  text-align: center; /* 폼 내용 가운데 정렬 */
}

/* 입력 필드 공통 스타일 */
.lead-capture-form input[type='text'],
.lead-capture-form input[type='email'],
.lead-capture-form input[type='date'],
.lead-capture-form button {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: none;
  border-radius: var(--leadform-border-radius, 5px);
  display: block;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  text-align: left; /* 입력 필드는 왼쪽 정렬 */
}

/* Date input */
.lead-capture-form input[type='date'] {
  text-align: left !important;
  direction: ltr;
  unicode-bidi: embed;
}

.lead-capture-form input:invalid {
  border: none;
}

/* 에러 메시지 스타일 */
.lead-capture-form .error-message {
  color: var(--leadform-error-color, #c00);
  font-size: 0.9em;
  margin-top: -7px;
  margin-bottom: 10px;
  display: none;
  position: relative;
  padding-left: 20px;
  text-align: left;
}

.lead-capture-form .error-message::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2217%22%20height%3D%2215%22%20viewBox%3D%220%200%2017%2015%22%20fill%3D%22%23c00%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.0264%2012.3086L9.46387%200.90625C8.97168%200.0585938%207.68652%200.03125%207.19434%200.90625L0.631836%2012.3086C0.139648%2013.1562%200.768555%2014.25%201.78027%2014.25H14.8779C15.8896%2014.25%2016.5186%2013.1836%2016.0264%2012.3086ZM8.34277%209.92969C9.02637%209.92969%209.60059%2010.5039%209.60059%2011.1875C9.60059%2011.8984%209.02637%2012.4453%208.34277%2012.4453C7.63184%2012.4453%207.08496%2011.8984%207.08496%2011.1875C7.08496%2010.5039%207.63184%209.92969%208.34277%209.92969ZM7.13965%205.41797C7.1123%205.22656%207.27637%205.0625%207.46777%205.0625H9.19043C9.38184%205.0625%209.5459%205.22656%209.51855%205.41797L9.32715%209.13672C9.2998%209.32812%209.16309%209.4375%208.99902%209.4375H7.65918C7.49512%209.4375%207.3584%209.32812%207.33105%209.13672L7.13965%205.41797Z%22%2F%3E%0A%3C%2Fsvg%3E%0A');
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

/* 폼 제출 후 에러 메시지 표시 규칙 */
.lead-capture-form.form-submitted input:invalid + .error-message,
.lead-capture-form.form-submitted
  .phone-input-group:has(input:invalid)
  + .error-message {
  display: none;
}

.lead-capture-form input:invalid + .error-message {
  display: none;
}

.lead-capture-form.form-submitted input:invalid + .error-message {
  display: none;
}

.lead-capture-form.form-submitted
  .phone-input-group:has(input:invalid)
  + .error-message {
  display: none;
}

.lead-capture-form.form-submitted .error-message.show {
  display: block;
}

/* 폼 제출 시에만 invalid 스타일 적용 */
.lead-capture-form.form-submitted input:invalid {
  border: 2px solid var(--leadform-error-color, #c00);
}

/* 체크박스 그룹 */
.lead-capture-form .checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  text-align: left;
  justify-content: flex-start;
}

/* 라디오 버튼 그룹 */
.lead-capture-form .radio-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  text-align: left;
  justify-content: flex-start;
}

.lead-capture-form p {
  margin-top: 15px;
  margin-bottom: 15px;
  font-weight: 700;
  text-align: left;
}

/* 전화번호 입력 그룹 스타일 */
.lead-capture-form .phone-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.lead-capture-form .phone-input-group select {
  width: 80px;
  padding: 10px;
  border: none;
  border-radius: var(--leadform-border-radius, 5px);
  background-color: var(--leadform-input-background, #fff);
  font-family: Arial, sans-serif;
  font-size: 16px;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
}

.lead-capture-form .phone-input-group input {
  flex: 1;
  margin-bottom: 0;
}

/* 제출 버튼 스타일 */
.lead-capture-form button {
  background-color: var(--leadform-primary-color, #c02a1e);
  color: var(--leadform-text-color, #fff);
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s ease;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lead-capture-form button:hover {
  background-color: var(--leadform-primary-hover, #900) !important;
}

.lead-capture-form button:active {
  background-color: var(--leadform-primary-hover, #900);
}

.lead-capture-form button:focus {
  background-color: var(--leadform-primary-color, #c00) !important;
}

.lead-capture-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #666 !important;
}

/* 체크박스 스타일 */
.lead-capture-form input[type='checkbox'] {
  margin-right: 10px;
  accent-color: var(--leadform-primary-color, #c00);
  width: 16px;
  height: 16px;
}

/* 라디오 버튼 스타일 */
.lead-capture-form input[type='radio'] {
  margin-right: 10px;
  accent-color: var(--leadform-primary-color, #c00);
  width: 16px;
  height: 16px;
}

/* 로딩 스피너 스타일 - 정 중앙에 위치 */
.lead-capture-form .loading-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  padding: 30px;
  border-radius: var(--leadform-border-radius, 10px);
  text-align: center;
  backdrop-filter: blur(5px);
}

.lead-capture-form .loading-spinner .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid var(--leadform-text-color, #fff);
  animation: leadFormSpin 1s linear infinite;
  margin: 0 auto 15px auto;
}

.lead-capture-form .loading-spinner p {
  color: var(--leadform-text-color, #fff);
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}

@keyframes leadFormSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 성공 메시지 UI - 가운데 정렬 및 아이콘 크기 증가 */
.lead-capture-form .success-container {
  display: none;
  text-align: center;
  padding: 30px 20px;
  background-color: rgba(0, 200, 0, 0.1);
  border-radius: var(--leadform-border-radius, 10px);
  margin: 20px auto 0 auto;
  max-width: 100%;
  border: 2px solid rgba(0, 200, 0, 0.3);
}

.lead-capture-form .success-container h3 {
  color: var(--leadform-success-color, #00ff00);
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: bold;
}

.lead-capture-form .success-icon {
  font-size: 72px; /* 아이콘 크기 대폭 증가 */
  color: var(--leadform-success-color, #00ff00);
  margin-bottom: 20px;
  display: block;
  line-height: 1;
  font-weight: bold;
}

/* 뒤로 가기 버튼 스타일 */
.lead-capture-form .back-button {
  background-color: #444;
  color: var(--leadform-text-color, #fff);
  padding: 12px 24px;
  border: none;
  border-radius: var(--leadform-border-radius, 5px);
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lead-capture-form .back-button:hover {
  background-color: #666;
}

/* 폼 외부 에러 메시지 스타일 (Email already in use 등) - 텍스트만, 아이콘 없음 */
.form-external-error {
  max-width: 600px;
  margin: 0px 20px;
  text-align: left;
  color: #ff0000;
  font-weight: bold;
}

/* Trial Schedule 인라인 로딩 */
.lead-capture-form .trial-loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.lead-capture-form .trial-loading-inline .spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid #fff;
  animation: leadFormSpin 1s linear infinite;
}

/* Trial Schedule 선택 버튼 */
.lead-capture-form .trial-select-button {
  background-color: var(--leadform-primary-color, #c02a1e) !important;
  color: #fff !important;
  padding: 12px 24px;
  border: none;
  border-radius: var(--leadform-border-radius, 5px);
  cursor: pointer;
  margin-top: 16px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: auto !important;
  display: inline-block;
}

.lead-capture-form .trial-select-button:hover {
  background-color: var(--leadform-primary-hover, #900) !important;
}

/* Trial Schedule 모달 오버레이 */
.trial-schedule-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

/* Trial Schedule 모달 */
.trial-schedule-modal {
  background: #fff !important;
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.trial-modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.trial-modal-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111 !important;
  text-align: left;
}

.trial-modal-header p {
  margin: 0;
  font-size: 14px;
  color: #6b7280 !important;
  font-weight: 400;
  text-align: left;
}

/* Trial 날짜 필터 */
.trial-date-filter {
  padding: 12px 24px 0;
}

.trial-date-input {
  width: 100%;
  padding: 10px 12px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #374151 !important;
  font-size: 14px !important;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
  cursor: pointer;
}

.trial-date-input:focus {
  outline: none;
  border-color: var(--leadform-primary-color, #c02a1e) !important;
}

.trial-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}

/* Trial Schedule 날짜 구분선 (스크롤 시 상단 고정) */
.trial-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding: 6px 0;
}

.trial-date-divider-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280 !important;
  white-space: nowrap;
}

.trial-date-divider-line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Trial Schedule 리스트 아이템 */
.trial-schedule-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px !important;
  margin-bottom: 6px;
  border: 2px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-color: #fff !important;
  cursor: pointer;
  font-family: Arial, sans-serif;
}

.trial-schedule-item:hover {
  background: #f9fafb !important;
  background-color: #f9fafb !important;
}

.trial-schedule-item.selected {
  border-color: var(--leadform-primary-color, #c02a1e) !important;
  background: rgba(192, 42, 30, 0.05) !important;
  background-color: rgba(192, 42, 30, 0.05) !important;
}

.trial-item-content {
  flex: 1;
  min-width: 0;
}

.trial-item-title {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: #111 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 시간 — 선택 기준이 되는 핵심 정보라 강조 */
.trial-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #111 !important;
}

.trial-item-instructor {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280 !important;
}

/* 선택 표시 (radio) */
.trial-item-radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}

.trial-schedule-item.selected .trial-item-radio {
  border-color: var(--leadform-primary-color, #c02a1e);
  background: var(--leadform-primary-color, #c02a1e);
}

.trial-schedule-item.selected .trial-item-radio::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.trial-empty-message {
  text-align: center;
  color: #6b7280 !important;
  padding: 32px 0;
  font-size: 14px;
}

/* Trial 모달 Footer */
.trial-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

.trial-modal-footer .trial-close-btn {
  padding: 10px 20px;
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  background: #fff !important;
  color: #374151 !important;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.trial-modal-footer .trial-close-btn:hover {
  background: #e5e7eb !important;
}

.trial-modal-footer .trial-confirm-btn {
  padding: 10px 20px;
  border: none !important;
  border-radius: 8px;
  background: var(--leadform-primary-color, #c02a1e) !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.trial-modal-footer .trial-confirm-btn:hover {
  background: var(--leadform-primary-hover, #900) !important;
}

.trial-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Trial 모달 로딩 */
.trial-loading {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.trial-loading .spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-radius: 50%;
  border-top: 3px solid #6b7280;
  animation: leadFormSpin 1s linear infinite;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  .lead-capture-form {
    /* padding: 15px; */
    /* margin: 0 10px;s */
  }

  .lead-form-container .form-title {
    font-size: 28px;
    margin: 15px 0;
  }

  .lead-capture-form .phone-input-group select {
    width: 70px;
    font-size: 14px;
  }

  .lead-capture-form input[type='text'],
  .lead-capture-form input[type='email'],
  .lead-capture-form input[type='date'] {
    font-size: 16px; /* iOS 줌 방지 */
  }

  .lead-capture-form .success-icon {
    font-size: 60px;
  }

  .lead-capture-form .loading-spinner {
    padding: 20px;
  }

  .lead-capture-form .loading-spinner .spinner {
    width: 40px;
    height: 40px;
  }

  /* Trial 모달 모바일 최적화 */
  .trial-schedule-modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .trial-schedule-modal {
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 480px) {
  .lead-capture-form {
    padding: 10px;
  }

  .lead-form-container .form-title {
    font-size: 24px;
    margin: 10px 0;
  }

  .lead-capture-form .phone-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .lead-capture-form .phone-input-group select {
    width: 100%;
  }

  .lead-capture-form .success-icon {
    font-size: 48px;
  }
}
