/* =============================================================
   르노코리아 청주대리점 상담 신청 페이지
   - 모바일 우선(반응형) / PC 분할 레이아웃
   ============================================================= */

/* ----- Design tokens ----- */
:root {
  /* Brand */
  --color-primary: #1a5fd4;
  --color-primary-dark: #003189;
  --color-primary-mid: #1a5fd4;
  --color-primary-light: #2e7dff;
  --color-yellow: #ffda00;

  /* Text */
  --color-text-strong: #181c26;
  --color-text-default: #444444;
  --color-text-medium: #555555;
  --color-text-muted: #717182;
  --color-text-soft: #99a1af;
  --color-text-footer: #6b7280;
  --color-text-footer-mid: #384151;
  --color-text-footer-soft: #949ca8;
  --color-text-on-bg: #45556c;

  /* Surfaces */
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-border: #efefef;
  --color-border-strong: rgba(0, 0, 0, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-card: 0 25px 50px rgba(0, 0, 0, 0.18);
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);

  /* Layout */
  --max-content: 1920px;
  --hero-pad-x: 24px;
  --form-pad: 24px;

  /* Type */
  --font-sans:
    "NanumSquareNeo-Variable", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-default);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
h1,
h2,
h3,
legend {
  margin: 0;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Layout: 모바일 기본(stack), 데스크톱(split)
   ============================================================ */
.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  background: linear-gradient(
    146deg,
    var(--color-primary-dark) 0%,
    var(--color-primary-mid) 60%,
    var(--color-primary-light) 100%
  );
  color: #fff;
  padding: clamp(40px, 12vw, 56px) clamp(16px, 5vw, 24px) 24px;
  overflow: hidden;
}

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
  z-index: 2;
}

/* 공식 법인딜러 뱃지 */
.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.15)
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  margin-bottom: 24px;
}

.hero__pill-icon {
  flex-shrink: 0;
  width: 22px;
}

/* 메인 타이틀 */
.hero__title {
  display: flex;
  flex-direction: column;
  font-weight: 900;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  word-break: keep-all;
}

.hero__title-line {
  display: block;
}

.hero__title-yellow {
  color: var(--color-yellow);
}

/* 서브 카피 */
.hero__desc {
  font-size: clamp(13px, 3.6vw, 14px);
  color: #dbeafe;
  margin-bottom: 24px;
  line-height: 1.5;
  letter-spacing: -0.3px;
  word-break: keep-all;
}

/* 4 feature badges */
.hero__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 32px;
  max-width: 460px;
  position: relative;
  z-index: 2;
}

.hero__feature {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  min-height: 44px;
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.hero__feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.hero__feature-text {
  font-size: clamp(12px, 3.4vw, 14px);
  color: #fff;
  letter-spacing: -0.4px;
  font-weight: 400;
  word-break: keep-all;
}

/* 차량 이미지 (모바일: 텍스트/feature 뱃지 아래 자연 흐름, 겹침 방지) */
.hero__car {
  position: relative;
  width: 100%;
  margin: 32px auto 0;
  text-align: center;
  z-index: 1;
}

.hero__car img {
  display: block;
  margin: 0 auto;
  max-width: 460px;
  width: 100%;
  height: auto;
}

/* 이미지 fallback이 적용되면 빈 공간 표시 */
.hero__car--fallback {
  min-height: 60px;
}

/* ===== 폼 카드 ===== */
.form-section {
  position: relative;
  background: #fff;
  padding: 24px clamp(12px, 4vw, 16px);
  flex: 1;
}

.card {
  width: 100%;
  max-width: 540px;
  margin: -16px auto 0;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px clamp(16px, 5vw, 20px);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 3;
}

.card__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.card__title {
  font-size: clamp(17px, 4.6vw, 20px);
  line-height: 1.45;
  letter-spacing: -0.4px;
  color: var(--color-text-default);
  font-weight: 800;
  word-break: keep-all;
}

.card__sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-medium);
  line-height: 1.45;
  letter-spacing: -0.3px;
}

.card__sub-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.card__sub-strong {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--color-text-medium);
}

/* ===== Form 공통 ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form__group--tabs > .form__label {
  margin-bottom: 8px;
}

.form__label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-default);
  letter-spacing: -0.3px;
  line-height: 24px;
}

.required {
  color: #ef4444;
}

.form__input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  /* 16px 이상으로 둬야 iOS Safari가 input focus 시 자동 줌인하지 않음 */
  font-size: 16px;
  letter-spacing: -0.15px;
  color: var(--color-text-default);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  outline: none;
}

.form__input::-webkit-input-placeholder {
  color: var(--color-text-muted);
}

.form__input::-moz-placeholder {
  color: var(--color-text-muted);
}

.form__input:-ms-input-placeholder {
  color: var(--color-text-muted);
}

.form__input::-ms-input-placeholder {
  color: var(--color-text-muted);
}

.form__input::placeholder {
  color: var(--color-text-muted);
}

.form__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 95, 212, 0.15);
}

.form__input.is-invalid,
.form__input[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form__textarea {
  height: auto;
  min-height: 64px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.45;
}

/* select 커스텀 */
.form__select-wrap {
  position: relative;
}

.form__select {
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
}

.form__select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: inline-flex;
}

/* ===== 상담 유형 탭 ===== */
.tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 12px;
  border: 1px solid #efefef;
  background: rgba(0, 0, 0, 0.01);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  text-align: center;
}

.tab:hover {
  border-color: rgba(26, 95, 212, 0.5);
  transform: translateY(-1px);
}

.tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab__title {
  font-weight: 800;
  font-size: 14px;
  color: #555555;
  letter-spacing: -0.15px;
  transition: color 0.2s ease;
}

.tab__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
  transition: color 0.2s ease;
}

.tab.is-active,
.tab:has(input:checked) {
  background: linear-gradient(180deg, rgba(248, 250, 255, 1) 0%, #ffffff 100%);
  border-color: #1a5fd4;
  box-shadow: 0px 12px 24px rgba(26, 95, 212, 0.12);
}

.tab.is-active .tab__title,
.tab:has(input:checked) .tab__title {
  color: #1a5fd4;
}

.tab.is-active .tab__desc,
.tab:has(input:checked) .tab__desc {
  color: #475569;
}

.tab:focus-within {
  outline: none;
  box-shadow: 0px 0px 0px 4px rgba(26, 95, 212, 0.12);
}

.tab.is-active:focus-within,
.tab:has(input:checked):focus-within {
  box-shadow:
    0px 12px 24px rgba(26, 95, 212, 0.12),
    0px 0px 0px 4px rgba(26, 95, 212, 0.12);
}

/* ===== 개인정보 동의 ===== */
.form__consent {
  background: var(--color-surface);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 4px;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.consent__check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.consent__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  background: #f3f3f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.consent__box svg {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.consent__check:checked + .consent__box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.consent__check:checked + .consent__box svg {
  opacity: 1;
}

.consent__check:focus-visible + .consent__box {
  outline: 2px solid rgba(26, 95, 212, 0.35);
  outline-offset: 2px;
}

.consent__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-on-bg);
}

.consent__text strong {
  font-weight: 700;
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.consent__sub {
  display: block;
  font-size: 12px;
  color: rgba(69, 85, 108, 0.65);
  font-weight: 400;
  line-height: 1.5;
}

/* ===== 제출 버튼 ===== */
.form__submit {
  width: 100%;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.4px;
  border-radius: var(--radius-md);
  margin-top: 6px;
  transition:
    background 0.15s ease,
    transform 0.05s ease;
}

.form__submit:hover {
  background: #1452bf;
}

.form__submit:active {
  transform: translateY(1px);
}

.form__submit:focus-visible {
  outline: 3px solid rgba(26, 95, 212, 0.35);
  outline-offset: 2px;
}

.form__submit[disabled] {
  background: #9aa9c1;
  cursor: not-allowed;
}

/* ===== Error / Feedback ===== */
.form__error {
  margin-top: -2px;
  font-size: 12px;
  color: #ef4444;
  line-height: 1.4;
}

.form__feedback {
  margin-top: 6px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form__feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ===== Footer ===== */
.footer {
  background: #fff;
  border-top: 1px solid #f1f3f5;
  padding: 32px clamp(16px, 5vw, 20px) 20px;
  font-family: var(--font-sans);
}

.footer__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto 20px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-strong);
}

.footer__brand-desc {
  font-size: 12px;
  color: var(--color-text-footer);
  line-height: 1.7;
}

.footer__heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: 0.48px;
}

.footer__line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.footer__key {
  color: var(--color-text-footer-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.11px;
  min-width: 64px;
}

.footer__val {
  color: var(--color-text-footer-mid);
  font-weight: 400;
}

.footer__val--strong {
  font-weight: 700;
}

.footer__val--link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #f1f3f5;
  max-width: 1440px;
  margin: 0 auto;
}

.footer__copy {
  font-size: 11px;
  color: var(--color-text-footer-soft);
}

.footer__divider {
  width: 1px;
  height: 10px;
  background: #bdc2ca;
}

/* ============================================================
   모바일 (≤ 767px) - 카드 풀폭 + Hero와 사이 여백 제거
   ============================================================ */
@media (max-width: 767px) {
  .form-section {
    padding: 0;
  }

  .form-section > .card {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }
}

/* ============================================================
   작은 모바일 (≤ 360px) - 좁은 화면 보호
   ============================================================ */
@media (max-width: 360px) {
  .hero__features {
    grid-template-columns: 1fr;
  }
  .hero__feature-text {
    font-size: 13px;
  }
  .footer__line {
    flex-wrap: wrap;
  }
  .footer__key {
    min-width: 56px;
  }
}

/* ============================================================
   Tablet (≥ 768px)
   ============================================================ */
@media (min-width: 768px) {
  .hero {
    padding: 80px 40px 0;
  }

  .hero__title {
    font-size: 44px;
    line-height: 1.27;
    margin-bottom: 16px;
  }

  .hero__desc {
    font-size: 17px;
    margin-bottom: 24px;
  }

  .hero__features {
    gap: 12px;
  }

  .hero__feature-text {
    font-size: 14px;
  }

  .form-section {
    padding: 32px 24px;
  }

  .card {
    padding: 32px 28px;
    margin-top: -32px;
  }

  .card__title {
    font-size: 24px;
  }

  .tabs {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer {
    padding: 40px 40px 24px;
  }

  .footer__body {
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
  }

  .footer__col--brand {
    flex: 1;
    min-width: 240px;
  }

  .footer__col {
    min-width: 200px;
  }
}

/* ============================================================
   Desktop (≥ 1080px) - 좌우 분할 레이아웃
   ============================================================ */
@media (min-width: 1080px) {
  .page {
    flex-direction: row;
    min-height: 920px;
  }

  /* Hero에 좌측 70% */
  .hero {
    flex: 1 1 64%;
    padding: 100px 0 0 0;
    min-height: 920px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .hero__inner {
    max-width: 720px;
    margin: 0 0 0 auto;
    padding: 0 40px 0 60px;
    width: 100%;
  }

  .hero__title {
    font-size: 48px;
    margin-bottom: 16px;
  }

  .hero__desc {
    font-size: 17px;
    margin-bottom: 24px;
  }

  .hero__features {
    margin-bottom: 0;
    gap: 12px;
  }

  .hero__feature-text {
    font-size: 14px;
  }

  /* 데스크톱에서는 차량 이미지를 absolute로 */
  .hero__car {
    margin: -80px 0 0 0;
    pointer-events: none;
    align-self: flex-end;
    width: 78%;
    max-width: 760px;
    transform: translate(18%, 60px);
  }

  .hero__car img {
    margin-right: 0;
    max-width: 720px;
  }

  /* 폼 영역 - 우측 36% */
  .form-section {
    flex: 0 0 580px;
    padding: 0;
    background: #fff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 920px;
  }

  .card {
    margin: 0 0 0 -20px;
    width: calc(100% + 20px);
    max-width: 540px;
    padding: 36px 32px;
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 3;
  }

  .card__title {
    font-size: 24px;
  }

  .footer {
    flex-basis: 100%;
    width: 100%;
    padding: 36px 60px 24px;
  }

  .footer__body {
    margin-bottom: 24px;
    gap: 40px;
  }

  .footer__col--brand {
    flex: 0 0 280px;
  }

  .footer__col {
    flex: 0 0 260px;
  }
}

/* ============================================================
   Wide Desktop (≥ 1440px)
   ============================================================ */
@media (min-width: 1440px) {
  .hero {
    flex-basis: calc(100% - 555px);
    padding-left: 80px;
  }

  .hero__inner {
    padding-left: 180px;
    padding-right: 40px;
    max-width: 1200px;
    margin-left: 0;
  }

  .hero__title {
    font-size: 48px;
    line-height: 1.27;
  }

  .hero__car {
    transform: translate(30%, 80px);
  }

  .form-section {
    flex: 0 0 535px;
  }

  .form-section .card {
    width: calc(100% + 20px);
    max-width: calc(100% + 20px);
    margin-left: -20px;
  }

  .footer {
    padding-left: 240px;
    padding-right: 240px;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Print 기본 ----- (선택) */
@media print {
  .form__submit,
  .hero__car {
    display: none;
  }
}
