/* ===================================================================
   signup.css — SaaSWeb 가입신청 공통 스타일
   =================================================================== */

:root {
    --signup-primary: #2563eb;
    --signup-primary-bg: #eff6ff;
    --signup-primary-border: #93c5fd;
    --signup-section-bg: #ffffff;
    --signup-section-border: #e5e7eb;
    --signup-radius: 12px;
    --signup-terms-bg: #f8f9fa;
}

/* Shell */
.signup-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* Header */
.signup-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.signup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.signup-subtitle {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.25rem;
}

.signup-subtitle-sub {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0;
}

/* Step Indicator */
.signup-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2.5rem;
}

.signup-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    min-width: 80px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #9ca3af;
    border: 2px solid #e5e7eb;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.step-label {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
}

.signup-step.active .step-circle {
    background: var(--signup-primary);
    color: #ffffff;
    border-color: var(--signup-primary);
}

.signup-step.active .step-label {
    color: var(--signup-primary);
    font-weight: 600;
}

.signup-step.done .step-circle {
    background: #dbeafe;
    color: var(--signup-primary);
    border-color: var(--signup-primary-border);
}

.signup-step.done .step-label {
    color: var(--signup-primary);
}

.signup-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin-top: -20px;
    max-width: 80px;
}

/* Section */
.signup-section {
    background: var(--signup-section-bg);
    border: 1px solid var(--signup-section-border);
    border-radius: var(--signup-radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}

.signup-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.25rem;
}

/* Error message */
.signup-error-msg {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
}

/* ── 캐러셀 ─────────────────────────────── */
.signup-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.signup-carousel__viewport {
    overflow: hidden;
    flex: 1;
}

.signup-carousel__track {
    display: flex;
    gap: 16px;
    transition: transform 0.3s ease;
}

.signup-carousel__arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 1;
}
.signup-carousel__arrow:hover:not(:disabled) { background: #f3f4f6; }
.signup-carousel__arrow:disabled { opacity: 0.3; cursor: default; }
.signup-carousel__arrow--prev { margin-right: 8px; }
.signup-carousel__arrow--next { margin-left: 8px; }

/* ── 상품 카드 ─────────────────────────────── */
.signup-product-card {
    flex: 0 0 calc(33.333% - 12px);
    min-width: 0;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    position: relative;
    box-sizing: border-box;
}
.signup-product-card:hover { border-color: #93c5fd; }
.signup-product-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.signup-product-card__badge {
    display: none;
    position: absolute;
    top: 12px; right: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.signup-product-card.selected .signup-product-card__badge { display: block; }

/* 카드 내 3행 레이블 구조 */
.signup-product-card__info {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.signup-product-card__row {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 8px;
}
.signup-product-card__row:last-child { border-bottom: none; padding-bottom: 0; }
.signup-product-card__row:first-child { padding-top: 0; }
.signup-product-card__row dt {
    flex-shrink: 0;
    width: 56px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding-top: 2px;
}
.signup-product-card__row dd {
    margin: 0;
    flex: 1;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
    word-break: keep-all;
}
.signup-product-card__row--price dt { color: #9ca3af; }
.signup-product-card__row--price dd { font-weight: 700; color: #2563eb; font-size: 15px; }

@media (max-width: 768px) {
    .signup-product-card { flex: 0 0 85%; }
}

/* All Agree */
.signup-all-agree {
    border: 1px solid var(--signup-section-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
}

.signup-all-agree-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.signup-all-agree-desc {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
    padding-left: 1.5rem;
}

/* Checkbox */
.signup-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--signup-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Terms List */
.signup-terms-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Terms Item */
.signup-terms-item {
    border: 1px solid var(--signup-section-border);
    border-radius: 8px;
    overflow: hidden;
}

.signup-terms-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #ffffff;
    gap: 0.75rem;
}

.signup-terms-item__check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.signup-terms-item__title {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

/* Terms Badge */
.signup-terms-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.signup-terms-badge.required {
    background: #fef3c7;
    color: #d97706;
}

.signup-terms-badge.optional {
    background: #f3f4f6;
    color: #6b7280;
}

/* Toggle Button */
.signup-terms-toggle-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}

.signup-terms-toggle-btn:hover {
    border-color: var(--signup-primary-border);
    color: var(--signup-primary);
}

/* Terms Content */
.signup-terms-content {
    padding: 1rem 1.25rem;
    background: var(--signup-terms-bg);
    border-top: 1px solid var(--signup-section-border);
    font-size: 0.82rem;
    color: #4b5563;
    line-height: 1.7;
    max-height: 300px;
    overflow-y: auto;
}

.signup-terms-content p { margin-bottom: 0.5rem; }
.signup-terms-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}
.signup-terms-content th,
.signup-terms-content td {
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.6rem;
    text-align: left;
}
.signup-terms-content th {
    background: #e5e7eb;
}

/* Nav Buttons */
.signup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.25rem;
}

/* ── step3 「안쪽 스크롤」 레이아웃 (signup-shell--app) ─────────────────────────
   단계 표시와 하단 버튼은 고정 자리에 두고 **가운데 내용만 스크롤**한다.
   🔴 sticky 로 겹쳐 두는 방식은 쓰지 않는다 — 배경이 비치고, 본문 폭만큼만 칠해져
      떠 있는 띠처럼 보이며, `backdrop-filter` 를 더하면 Chrome 에서 합성 레이어가
      깨진다(2026-08-11 실측, 세 증상 모두 재현됨).
   MESWeb 이 목록 화면에서 쓰는 `:has()` + flex 체인과 같은 패턴이다. */
body.public-shell:has(.signup-shell--app) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body.public-shell:has(.signup-shell--app) .public-main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.signup-shell--app {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
}

/* 🔴 form 도 flex 체인에 넣어야 한다 — 빠뜨리면 min-height:0 이 끊겨 스크롤 영역이
   안 줄고 페이지 전체가 늘어난다. */
.signup-shell--app > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.signup-shell--app .signup-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.signup-shell--app .signup-nav {
    flex: 0 0 auto;
    padding: 1rem 0 1.25rem;
}

.signup-btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.25rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.signup-btn-prev:hover {
    border-color: #9ca3af;
    color: #374151;
    background: #f9fafb;
}

.signup-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 2rem;
    border: none;
    border-radius: 8px;
    background: var(--signup-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.signup-btn-next:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

@media (max-width: 576px) {
    .signup-shell {
        padding: 1.5rem 1rem 3rem;
    }

    .signup-section {
        padding: 1.25rem 1rem;
    }

    .signup-step-indicator {
        gap: 0;
    }

    .signup-step {
        min-width: 60px;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .signup-nav {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .signup-nav a,
    .signup-next-btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Step3 폼 스타일 ────────────────────────────── */
.signup-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
}

.signup-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* 12컬럼 span 유틸 — sgrid- 접두어로 Bootstrap .col-* 충돌 방지 */
.sgrid-3  { grid-column: span 3; }
.sgrid-4  { grid-column: span 4; }
.sgrid-5  { grid-column: span 5; }
.sgrid-6  { grid-column: span 6; }
.sgrid-7  { grid-column: span 7; }
.sgrid-8  { grid-column: span 8; }
.sgrid-12 { grid-column: span 12; }

/* 기존 호환 */
.signup-form-group--full { grid-column: 1 / -1; }

@media (max-width: 640px) {
    .signup-form-grid > .signup-form-group { grid-column: 1 / -1; }
}

.signup-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.signup-form-label--required::after {
    content: " *";
    color: #dc2626;
}

.signup-form-input {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.signup-form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.signup-form-input.is-invalid {
    border-color: #dc2626;
}

.field-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.125rem;
}

.signup-regno-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.signup-regno-row input {
    flex: 1;
}

.signup-regno-lookup-btn {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    background: #2563eb;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.signup-regno-lookup-btn:hover {
    background: #1d4ed8;
}

.signup-regno-lookup-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* 주소 검색 버튼 (regno 버튼과 동일 베이스, 아웃라인 변형) */
.signup-address-search-btn {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.signup-address-search-btn:hover {
    background: #eff6ff;
}

/* readonly 입력 (주소 API 자동 채움 필드) */
.signup-form-input[readonly] {
    background: #f9fafb;
    color: #374151;
    cursor: default;
}

.signup-lookup-msg {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.signup-lookup-msg--found {
    color: #15803d;
}

.signup-lookup-msg--notfound {
    color: #6b7280;
}

.signup-product-banner {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.signup-product-banner__name {
    font-weight: 600;
    color: #1e3a8a;
}

.signup-product-banner__price {
    font-size: 0.875rem;
    color: #2563eb;
}

/* ── Step4 완료 카드 ────────────────────────────── */
.signup-complete-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 1rem;
}

.signup-complete-icon {
    margin-bottom: 1.5rem;
}

.signup-complete-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.signup-complete-applyno {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.signup-complete-applyno strong {
    color: #2563eb;
}

.signup-complete-desc {
    font-size: 0.9375rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.signup-complete-home-btn {
    display: inline-flex;
    justify-content: center;
    text-decoration: none;
}

/* 라디오 그룹 */
.signup-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 0.25rem;
}
.signup-radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}
.signup-radio {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
/* 체크박스 레이블 (구독 연장) */
.signup-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}
/* 안내 문구 */
.signup-info-note {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* 구독 주기 인라인 (월간 ○ — 기간 입력 — ○ 연간) */
.signup-cycle-inline {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}
.signup-cycle-months {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.signup-cycle-months .signup-form-input {
    width: 4.5rem;
    text-align: center;
    padding: 0.375rem 0.25rem;
}
.signup-cycle-unit {
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
}
.signup-required-mark {
    color: #dc2626;
}

/* ===== 가입신청 조회 (/signup/status) ===== */

/* 카드 골격은 Step2~4 의 signup-shell·signup-section 을 그대로 쓴다. 폼이 짧아(입력 2칸) 카드를 가운데 좁게 둔다:
   가장 긴 항목(이메일 360px)과 결과 표(상품명 가변 + 신청일 110px + 상태 100px)가 들어가는 폭이면 충분하다. */
.signup-status-shell {
    max-width: 720px;
}

.signup-status-card {
    margin-bottom: 0;
}

/* 입력란 폭은 항목의 데이터에 맞춘다(균등 분할 금지 — ui-conventions 「입력란 폭」).
   · 사업자등록번호 000-00-00000 = 12자 → ~200px
   · 신청자 이메일 = 가변 길이(최대 256자)라 남는 폭을 쓰되 읽기 좋게 ~360px 에서 멈춘다
   · 인증코드 = 숫자 6자리 → 글자 간격을 넓혀 ~110px(6자 + 좌우 여백) */
.signup-status-field--regno {
    width: 100%;
    max-width: 200px;
    margin-bottom: 1rem;
}

.signup-status-field--email {
    width: 100%;
    max-width: 360px;
}

.signup-status-field--code {
    width: 100%;
    max-width: 110px;
}

.signup-status-code-input {
    letter-spacing: 0.25em;
    text-align: center;
}

/* ② 에서 방금 입력한 사업자번호·이메일을 읽기 전용 글자로 보여 준다 — 값이 짧아 한 줄 두 칸(라벨 | 값)으로 둔다. */
.signup-status-readonly {
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.signup-status-readonly > div {
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.signup-status-readonly dt {
    flex: 0 0 8.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.signup-status-readonly dd {
    margin: 0;
    font-size: 0.9375rem;
    color: #111827;
    word-break: break-all;
}

.signup-status-note {
    margin-top: 0.75rem;
}

.signup-status-note a {
    color: var(--signup-primary);
}

/* 짧은 폼은 위로 붙이고 여백은 아래로 — 버튼 줄만 위쪽 간격을 둔다. */
.signup-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* 보조 버튼(.signup-btn-prev)을 <button> 으로 쓸 때 브라우저 기본 글꼴·커서가 비는 것을 막는다. */
.signup-status-actions button {
    font-family: inherit;
    cursor: pointer;
}

/* ③ 결과 표 — 고정 길이 칸(신청일 yyyy-MM-dd·상태 라벨)은 고정 폭, 가변 길이(상품명)만 남는 폭을 쓴다. */
.signup-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.signup-status-table th,
.signup-status-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--signup-section-border);
    text-align: left;
}

.signup-status-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    white-space: nowrap;
}

.signup-status-table__date {
    width: 110px;
    white-space: nowrap;
}

.signup-status-table__status {
    width: 100px;
    white-space: nowrap;
}

.signup-status-empty {
    margin: 0;
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* 토스트 — Contact.cshtml 의 인라인 스타일과 같은 모양을 클래스로 둔 것(slideInToast 는 site-saas.css 에 있다). */
.signup-status-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    border-radius: 0.9rem;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 380px;
    animation: slideInToast 0.3s ease;
}

.signup-status-toast--success {
    background: #0f7b6c;
    box-shadow: 0 4px 20px rgba(10, 79, 69, 0.35);
}

.signup-status-toast--error {
    background: #b91c1c;
    box-shadow: 0 4px 20px rgba(185, 28, 28, 0.35);
}

.signup-status-toast__close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    flex-shrink: 0;
}

/* 토스트가 둘 다 뜨는 경우(성공 + 오류) 겹치지 않게 오류를 위로 올린다. */
.signup-status-toast--success + .signup-status-toast--error {
    bottom: 6rem;
}

@media (max-width: 576px) {
    .signup-status-readonly > div {
        flex-direction: column;
        gap: 0.125rem;
    }

    /* 세로로 쌓으면 dt 의 flex-basis(8.5rem)가 높이로 바뀌어 136px 빈칸이 생긴다 — 해제한다. */
    .signup-status-readonly dt {
        flex: none;
    }

    .signup-status-toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* ===== Step4 — 가입신청 조회 보조 버튼 ===== */
.signup-complete-desc--tight {
    margin-bottom: 0.5rem;
}

.signup-complete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}
