/* ── 토스 스타일 레퍼럴 등록 ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
    --blue: #3182f6;
    --blue-light: #e8f3ff;
    --bg: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f2f4f6;
    --gray-200: #e5e8eb;
    --gray-400: #b0b8c1;
    --gray-500: #8b95a1;
    --gray-600: #6b7684;
    --gray-800: #333d4b;
    --gray-900: #191f28;
    --red: #f04452;
    --green: #00c472;
    --radius: 16px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
}

/* ── 스텝 ── */
.step {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    animation: fadeUp 0.35s ease;
}
.step.hidden { display: none; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 0 20px;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px 4px;
}

/* ── 이모지 히어로 ── */
.emoji-hero {
    font-size: 56px;
    margin-bottom: 24px;
    line-height: 1;
}

/* ── 타이틀 ── */
h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.5px;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.blue { color: var(--blue); }

.desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-600);
    margin-bottom: 28px;
}

/* ── 등급 프리뷰 ── */
.tier-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-50);
    border-radius: 12px;
    padding: 14px 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.tier-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--gray-600);
}
.tier-item strong {
    color: var(--gray-900);
    font-weight: 700;
}
.tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.tier-arrow {
    color: var(--gray-400);
    font-size: 12px;
}

/* ── 추천인 배너 ── */
.referrer-banner {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--blue-light);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--blue);
    font-weight: 500;
    margin-bottom: 16px;
}
.referrer-banner.visible { display: flex; }

/* ── 하단 영역 ── */
.bottom-area {
    padding-bottom: 40px;
    padding-top: 8px;
}

/* ── 입력 ── */
.phone-input-wrap {
    margin-bottom: 14px;
}
.phone-input-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.phone-input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    font-size: 17px;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
}
.phone-input-wrap input:focus {
    border-color: var(--blue);
}
.phone-input-wrap input::placeholder {
    color: var(--gray-400);
}

/* ── 개인정보 ── */
.privacy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.privacy-row input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--blue);
    cursor: pointer;
}
.privacy-row label {
    font-size: 13px;
    color: var(--gray-500);
}
.privacy-row a {
    color: var(--gray-600);
    text-decoration: underline;
}

/* ── 메인 버튼 ── */
.btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-main:hover { background: #1b6ef2; }
.btn-main:active { transform: scale(0.985); }
.btn-main:disabled { background: var(--gray-200); color: var(--gray-400); cursor: default; }

.btn-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    background: var(--gray-100);
    color: var(--gray-800);
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: none;
}

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

/* ── 에러 ── */
.error-msg {
    font-size: 14px;
    color: var(--red);
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

/* ── 로그인 링크 ── */
.login-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-500);
}
.login-link a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

/* ── 인증번호 ── */
.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 28px 0 16px;
}
.code-input {
    width: 48px;
    height: 58px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    outline: none;
    color: var(--gray-900);
    font-family: inherit;
    transition: border-color 0.2s;
}
.code-input:focus {
    border-color: var(--blue);
}

.timer {
    text-align: center;
    font-size: 15px;
    color: var(--blue);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}
.timer.expired { color: var(--red); }

.resend-btn {
    display: block;
    margin: 0 auto;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
}
.resend-btn:disabled {
    color: var(--gray-400);
    cursor: default;
}

/* ── 결과 ── */
.result-card {
    background: var(--gray-50);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
}
.result-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 8px;
}
.result-code {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--gray-900);
}
.result-link-row {
    display: flex;
    gap: 8px;
}
.result-link-row input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 13px;
    color: var(--gray-600);
    background: #fff;
    outline: none;
    font-family: inherit;
}
.copy-btn {
    height: 44px;
    padding: 0 16px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.copy-btn:active { transform: scale(0.96); }

.coupon-card {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 1.5px dashed #f59e0b;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin-bottom: 12px;
}
.coupon-badge {
    font-size: 13px;
    color: #b45309;
    font-weight: 600;
    margin-bottom: 8px;
}
.coupon-code {
    font-size: 22px;
    font-weight: 800;
    color: #d97706;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.coupon-amount {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 12px;
}
.coupon-copy {
    background: #f59e0b;
}

/* ── 반응형 ── */
@media (max-width: 380px) {
    h1 { font-size: 23px; }
    .emoji-hero { font-size: 48px; }
    .code-input { width: 42px; height: 52px; font-size: 20px; }
}
