/* ═══════════════════════════════════════════════════════════════
   SAVE ENERGY — Landing Page Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --primary:        #0052A3;
  --primary-dark:   #003d7a;
  --primary-light:  #1a6fc4;
  --accent:         #F59E0B;
  --accent-dark:    #D97706;
  --kakao:          #FEE500;
  --green:          #22C55E;
  --green-dark:     #16A34A;
  --bg:             #F4F6F9;
  --card:           #FFFFFF;
  --text:           #111827;
  --text-muted:     #6B7280;
  --border:         #E5E7EB;
  --shadow-sm:      0 2px 8px rgba(0,0,0,.06);
  --shadow-md:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.14);
  --radius:         16px;
  --transition:     .65s cubic-bezier(.22,.61,.36,1);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.header-inner {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-main {
  font-size: 18px;
  font-weight: 800;
  color: #F97316;
  letter-spacing: -.5px;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .5px;
  font-weight: 500;
}
.header-cta {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 50px;
  letter-spacing: -.3px;
  transition: background .2s, transform .2s;
  white-space: nowrap;
}
.header-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }
.header-cta:active { transform: translateY(0); }

/* ─── Main Wrapper ───────────────────────────────────────────── */
.page-main {
  padding-top: 64px;       /* header height */
  padding-bottom: 40px;
  min-height: 100vh;
}

/* ─── Image Container ────────────────────────────────────────── */
.image-stack {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── Image Section ──────────────────────────────────────────── */
.img-section {
  position: relative;
  overflow: hidden;
  background: var(--card);
}
.img-section:first-child {
  border-radius: 0 0 var(--radius) var(--radius);
}
.img-section + .img-section {
  margin-top: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.img-section img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: inherit;
  transition: transform .5s ease;
}
.img-section:hover img { transform: scale(1.005); }

/* ─── Scroll Reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(48px) scale(.98);
  transition:
    opacity var(--transition),
    transform var(--transition);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger delays */
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .14s; }

/* ─── Final CTA Banner ───────────────────────────────────────── */
.cta-banner {
  max-width: 640px;
  margin: 24px auto 0;
  background: linear-gradient(135deg, var(--primary) 0%, #1a6fc4 100%);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-banner h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.cta-banner p {
  font-size: 14px;
  opacity: .88;
  margin-bottom: 24px;
  line-height: 1.7;
}
.cta-btn-large {
  display: inline-block;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 800;
  padding: 16px 40px;
  border-radius: 50px;
  letter-spacing: -.3px;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(245,158,11,.4);
}
.cta-btn-large:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245,158,11,.5);
}
.cta-btn-large:active { transform: translateY(0); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 32px 20px 100px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
}
.site-footer strong { color: var(--text); font-weight: 600; }

/* ─── Floating Buttons ───────────────────────────────────────── */
.float-wrap {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Consult button (top of stack — visually prominent) */
.float-consult {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,82,163,.40);
  letter-spacing: -.3px;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
  min-height: 50px;
}
.float-consult:hover  { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,82,163,.5); }
.float-consult:active { transform: translateY(0); }
.float-consult svg    { flex-shrink: 0; }

/* Icon-only round buttons (kakao / phone) */
.float-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .2s, box-shadow .2s;
}
.float-icon:hover  { transform: translateY(-3px) scale(1.07); box-shadow: var(--shadow-lg); }
.float-icon:active { transform: translateY(0) scale(1); }

.float-kakao  { background: var(--kakao); }
.float-phone  { background: var(--green); }
.float-phone svg { color: #fff; }

/* Float entrance animation */
.float-wrap { animation: floatIn .5s .8s ease both; }
@keyframes floatIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Modal Overlay ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,15,30,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 36px 28px 28px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  transform: translateY(24px) scale(.97);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
}
.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

/* scrollbar */
.modal-card::-webkit-scrollbar { width: 4px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 14px;
  letter-spacing: -.2px;
}
.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  margin-bottom: 4px;
}
.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Form ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .req { color: #EF4444; margin-left: 2px; }
.form-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,82,163,.12);
}
.form-input::placeholder { color: #9CA3AF; }
.form-input.error { border-color: #EF4444; }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Error message */
.form-error {
  display: none;
  background: #FEF2F2;
  color: #DC2626;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #FECACA;
}
.form-error.show { display: block; }

/* Submit button */
.form-submit {
  width: 100%;
  height: 54px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
  letter-spacing: -.3px;
  margin-top: 8px;
  transition: opacity .2s, transform .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.form-submit:hover   { opacity: .9; transform: translateY(-1px); }
.form-submit:active  { transform: translateY(0); }
.form-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Success state */
.modal-success {
  display: none;
  text-align: center;
  padding: 20px 0 10px;
}
.modal-success.show { display: block; }
.success-icon {
  width: 72px; height: 72px;
  background: #ECFDF5;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.success-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: 10px;
  color: var(--text);
}
.success-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}
.success-close-btn {
  width: 100%;
  height: 50px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  transition: background .2s;
}
.success-close-btn:hover { background: var(--border); }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.form-submit.loading .spinner { display: block; }
.form-submit.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Top Scroll Indicator ───────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 64px; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 901;
  width: 0%;
  transition: width .1s linear;
  overflow: visible;
}

.scroll-icon {
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-55%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  animation: boltPulse 1s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 5px rgba(249,115,22,.85));
}

@keyframes boltPulse {
  from {
    filter: drop-shadow(0 0 4px rgba(249,115,22,.6));
    transform: translateY(-55%) scale(1);
  }
  to {
    filter: drop-shadow(0 0 10px rgba(249,115,22,1));
    transform: translateY(-55%) scale(1.25);
  }
}

/* ─── Responsive ─────────────────────────────────────────────── */

/* Mobile: 360–767px */
@media (max-width: 767px) {
  .image-stack {
    padding: 12px 0 0;
    gap: 0;
  }
  .img-section + .img-section { margin-top: 12px; border-radius: 12px; }
  .img-section:first-child { border-radius: 0; }

  .cta-banner {
    margin: 16px 12px 0;
    border-radius: 12px;
    padding: 28px 20px;
  }
  .cta-banner h2 { font-size: 18px; }
  .cta-btn-large { padding: 14px 32px; font-size: 15px; }

  .float-wrap { right: 14px; bottom: 20px; gap: 8px; }
  .float-consult { font-size: 13px; padding: 12px 16px; min-height: 46px; }
  .float-icon { width: 46px; height: 46px; }

  .modal-card { padding: 28px 20px 24px; border-radius: 20px; }
  .modal-title { font-size: 19px; }

  .site-footer { padding-bottom: 120px; }
}

/* Tablet: 768–1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .image-stack {
    padding: 24px 24px 0;
    gap: 0;
  }
  .img-section + .img-section { margin-top: 16px; }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  .image-stack { padding: 32px 0 0; }
  .img-section + .img-section { margin-top: 20px; }
  .cta-banner { margin: 28px auto 0; }
}

/* Large: 1600px+ */
@media (min-width: 1600px) {
  .image-stack { max-width: 680px; }
  .cta-banner  { max-width: 680px; }
}

/* Safe area for iOS home bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .float-wrap {
    bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .site-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}
