/* 고객 페이지 — UrbanPort 블루 유지, 모바일 신청 흐름 우선 */
:root {
  --up-primary: #3182f6;
  --up-primary-hover: #1b64da;
  --up-primary-soft: #e8f1ff;
  --up-navy: #162b46;
  --up-surface: #eaf2fb;
  --up-warning: #e8a23e;
  --up-page: #f5f7fa;
  --up-bottom-nav-h: 3.75rem;
  --up-keyboard-inset: 0px;
}

a.up-logo-home {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}
img[alt="로고"],
img[alt="UrbanPort"] {
  height: auto;
  max-height: 1.75rem;
  width: auto !important;
  max-width: 180px;
  object-fit: contain;
}

.up-skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 80;
  background: #3182f6;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
}
.up-skip:focus { top: 8px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select,
textarea,
button:not(.nav-item) {
  min-height: 44px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #3182f6;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #3182f6;
  outline-offset: 2px;
}

.up-stepper {
  display: flex;
  align-items: flex-start;
  counter-reset: upstep;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 14px 20px 12px;
  background: #fff;
}
.up-stepper li {
  flex: 1;
  position: relative;
  counter-increment: upstep;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-height: 0;
}
.up-stepper li::before {
  content: counter(upstep);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #e5e8eb;
  background: #fff;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-sizing: border-box;
}
.up-stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: #e5e8eb;
  z-index: 0;
}
.up-stepper li.is-done {
  color: #3182f6;
  background: none;
}
.up-stepper li.is-done::before {
  content: "✓";
  background: #3182f6;
  border-color: #3182f6;
  color: #fff;
  font-size: 13px;
}
.up-stepper li.is-done:not(:last-child)::after {
  background: #3182f6;
}
.up-stepper li.is-current {
  color: #191f28;
  background: none;
}
.up-stepper li.is-current::before {
  background: #3182f6;
  border-color: #3182f6;
  color: #fff;
  box-shadow: 0 0 0 4px #e8f1ff;
}
.up-stepper + .h-1\.5 {
  display: none !important;
}

#customer-bottom-nav a,
.up-bottom-nav .nav-item {
  min-height: 3.5rem;
  -webkit-tap-highlight-color: transparent;
}
#customer-bottom-nav a.active,
#customer-bottom-nav a.text-blue-600 {
  color: #3182f6;
}

.up-auth-logo {
  display: block;
  margin: 0 auto 14px;
  max-height: 1.5rem;
  width: auto;
  max-width: 140px;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none !important; }
}

/* —— 모바일: 웹 문서가 아니라 앱 셸 —— */
@media (max-width: 767.98px) {
  html {
    -webkit-text-size-adjust: 100%;
    background: #eef1f6;
  }
  body {
    padding-bottom: calc(var(--up-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 28px) !important;
    background: #eef1f6 !important;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    touch-action: manipulation;
  }

  .up-mobile-header,
  body > .md\:hidden.p-4.bg-white {
    position: sticky;
    top: 0;
    z-index: 35;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 10px !important;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(1.2) blur(16px);
    -webkit-backdrop-filter: saturate(1.2) blur(16px);
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }
  .up-mobile-header a:not(.up-logo-home),
  .up-mobile-header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px !important;
  }
  .up-mobile-header a[href="/register"] {
    background: #3182f6 !important;
    color: #fff !important;
    border: 0 !important;
  }
  .up-mobile-header .hidden {
    display: none !important;
  }

  body > .max-w-5xl.mx-auto {
    max-width: none !important;
    padding: 0 !important;
    min-height: 0 !important;
  }

  #apply-main {
    display: block !important;
    width: 100%;
  }
  #apply-main > div {
    max-width: none !important;
    width: auto !important;
    margin: 12px 12px 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.05) !important;
    border: 0 !important;
    background: #fff;
    /* overflow:hidden makes this card the sticky scrollport, pushing .up-sticky-cta over the content above it */
    overflow: visible !important;
  }

  .up-stepper {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f2f4f6;
  }
  .up-stepper li {
    font-size: 11px;
    padding: 0;
  }

  #apply-main .p-8,
  #apply-main .pt-10,
  #apply-main .md\:p-10,
  #apply-main .md\:pt-10 {
    padding: 16px 16px 20px !important;
  }
  #apply-main .mb-8 { margin-bottom: 1rem !important; }
  #page-title { font-size: 1.25rem !important; line-height: 1.35; }
  #service-badge { margin-bottom: 6px !important; }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
    border-radius: 12px !important;
    background: #f4f6f8;
    border-color: #e5e8eb !important;
  }
  #page-title,
  #apply-main h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
  }
  body > .min-h-screen:not(.justify-center) {
    padding: 12px 12px 0 !important;
    background: transparent;
  }

  #customer-bottom-nav {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    height: auto;
    padding: 6px 4px !important;
    border: 0 !important;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(1.2) blur(18px);
    -webkit-backdrop-filter: saturate(1.2) blur(18px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  }
  #customer-bottom-nav > .flex,
  #customer-bottom-nav.up-bottom-nav {
    min-height: var(--up-bottom-nav-h);
    height: auto;
    align-items: stretch;
  }
  body:has(.up-mobile-header) #customer-bottom-nav a[data-nav-key="auth"] {
    display: none !important;
  }
  #customer-bottom-nav a,
  .up-bottom-nav .nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: var(--up-bottom-nav-h);
    padding: 4px 2px 6px;
    gap: 3px;
    color: #8b95a1 !important;
    text-decoration: none;
  }
  #customer-bottom-nav a.active,
  .up-bottom-nav .nav-item.active {
    color: #3182f6 !important;
  }
  #customer-bottom-nav a > span,
  #customer-bottom-nav a > i {
    line-height: 1.15;
  }
  #customer-bottom-nav a span:last-child,
  .up-bottom-nav .nav-item span {
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: -0.03em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #customer-bottom-nav a > span:first-child,
  #customer-bottom-nav a > i {
    font-size: 1.05rem;
    margin-bottom: 0 !important;
    min-width: 36px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
  }
  #customer-bottom-nav a.active > span:first-child,
  #customer-bottom-nav a.active > i,
  .up-bottom-nav .nav-item.active > i {
    background: #e8f1ff;
    color: #3182f6;
  }
  #customer-bottom-nav a:active > span:first-child,
  #customer-bottom-nav a:active > i {
    transform: scale(0.94);
  }

  .up-sticky-cta,
  #apply-main button.w-full,
  #apply-main a.w-full {
    border-radius: 14px !important;
  }
  #apply-main button:active,
  #apply-main a:active {
    transform: scale(0.985);
  }
  .up-sticky-cta {
    position: sticky;
    bottom: calc(var(--up-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 22px);
    z-index: 25;
    margin-top: 12px !important;
    box-shadow: 0 8px 24px rgba(49, 130, 246, 0.28) !important;
  }

  #legal-footer {
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
  }

  #support-float { display: none !important; }

  /* 로그인·회원가입은 떠 있는 웹 카드 대신 화면을 채우는 시트 */
  body > .flex.flex-col.items-center.justify-center {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 0 0 !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    min-height: 100dvh !important;
    background: #eef1f6;
  }
  body > .flex.flex-col.items-center .max-w-\[480px\],
  body > .flex.flex-col.items-center .rounded-\[32px\] {
    max-width: none;
    flex: 1 1 auto;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: none !important;
  }
  body > .flex.flex-col.items-center .p-8 {
    padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* fade-in의 translateY(0)가 남으면 position:fixed가 카드 기준으로 갇힌다 */
  .fade-in {
    animation: none !important;
    transform: none !important;
  }

  /* 검색 제안은 카드 overflow에 잘리지 않고, 하단 탭(z-index 1040) 위에 붙는다 */
  #product-list:not(.hidden),
  #billing-product-dropdown:not(.hidden),
  #site-name-list.absolute:not(.hidden),
  #refund-site-list:not(.hidden) {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: calc(var(--up-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 32px);
    z-index: 1100;
    max-height: min(46dvh, 18rem);
    margin: 0;
    overflow-y: auto;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  }
}

#payment-autofill-banner,
#payment-vehicle-quickpick {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

/* 서비스 포털 · 필드 오류 · 키보드 */
#portal-home.up-apply-collapsed { display: none !important; }
#apply-shell { display: none !important; }
#apply-shell.is-open { display: block !important; }
html.up-direct-apply #portal-home { display: none !important; }
html.up-direct-apply #apply-shell { display: block !important; }
@media (min-width: 768px) {
  #apply-shell.is-open,
  html.up-direct-apply #apply-shell {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2.5rem;
    align-items: start;
  }
}

.up-portal { color: var(--up-navy); }
.up-home { width: 100%; max-width: 32rem; }
@media (min-width: 768px) {
  .up-home { margin-inline: auto; }
}
@media (max-width: 767.98px) {
  .up-home {
    width: auto;
    max-width: none;
    margin: 8px 12px 0;
  }
}
.up-home-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 18px;
  border: 0;
  border-radius: 20px;
  background: var(--up-primary);
  color: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.22);
  cursor: pointer;
}
.up-home-primary:hover { background: var(--up-primary-hover); }
.up-home-primary:active { transform: translateY(1px); }
.up-home-primary-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-home-primary h1 {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.up-home-primary-copy > span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.up-home-go {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--up-primary-hover);
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}
.up-home-note {
  margin: 10px 4px 0;
  color: #667085;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.up-menu {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(22, 43, 70, 0.04);
}
.up-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--up-navy);
  border-top: 1px solid #eef2f6;
}
.up-menu a:first-child { border-top: 0; }
.up-menu a:hover { background: #f7faff; }
.up-menu a:active { background: var(--up-surface); }
.up-menu-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--up-primary-soft);
  color: var(--up-primary-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
}
.up-menu-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.up-menu-copy strong { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.up-menu-copy em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.35;
}
.up-menu-chev {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #c5ced8;
  border-top: 2px solid #c5ced8;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.up-portal-kicker {
  margin: 0 0 8px;
  color: var(--up-primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.up-portal-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--up-navy);
}
.up-portal-lead {
  margin: 12px 0 0;
  max-width: 36rem;
  color: #667085;
  font-size: 15px;
  line-height: 1.55;
}
.up-portal-section {
  margin: 28px 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.up-portal-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 390px) {
  .up-portal-grid { grid-template-columns: 1fr 1fr; }
}
.up-portal-grid.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .up-portal-title { font-size: 2.25rem; }
  .up-portal-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .up-portal-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.up-service-card {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 148px;
  height: 100%;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e6ebf2;
  box-shadow: 0 1px 2px rgba(22, 43, 70, 0.04);
  color: var(--up-navy);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.up-service-card strong { font-size: 16px; letter-spacing: -0.02em; }
.up-service-card span { font-size: 13px; color: #667085; line-height: 1.45; font-weight: 600; }
.up-service-card:active { background: var(--up-surface); }
.up-help-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.up-help-row a,
.up-help-row button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d7dee8;
  background: #fff;
  color: var(--up-navy);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.up-field-error {
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0 0 4px;
  line-height: 1.4;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #d92d20 !important;
  background: #fff6f5 !important;
}
.up-pay-summary {
  text-align: left;
  background: var(--up-surface);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--up-navy);
}
.up-pay-summary p { margin: 0; }
.up-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.up-status-ok { background: #e7f6ee; color: #087443; }
.up-status-soon { background: #fff6e5; color: #9a6700; }
.up-status-end { background: #f2f4f7; color: #475467; }
.up-status-wait { background: #eaf2fb; color: #1849a9; }
.up-status-pay { background: #fff1f0; color: #b42318; }
.up-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.up-quick-row a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  background: #f4f6f8;
  color: var(--up-navy);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
body.up-keyboard-open #customer-bottom-nav,
body.up-keyboard-open #support-float {
  transform: translateY(140%);
  pointer-events: none;
}
body.up-paying #btn-pay-card,
body.up-paying #btn-pay-transfer,
body.up-paying #btn-pay-virtual,
body.up-paying #btn-pay-deposit {
  opacity: 0.55;
  pointer-events: none;
}
