/* =============================================================
   로그인 / 회원가입 페이지 스타일 (auth/sign-in.php · signup.php)
   토큰: 히어로 #0f0c29→#302b63→#24243e / 액센트 #667eea→#764ba2
         카드 radius 16 · border #f0f0f0 · Noto Sans KR · 991/768/480
   ============================================================= */

.auth-body { opacity: 0; transition: opacity 0.5s ease; margin: 0; }
.auth-body.page-loaded { opacity: 1; }
html { scroll-behavior: smooth; }

.auth-main {
    min-height: calc(100vh - 220px);
    padding: 56px 15px 70px;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative; overflow: hidden;
}
.auth-main::before {
    content: ''; position: absolute; top: -30%; right: -10%;
    width: 520px; height: 520px; border-radius: 50%;
    background: radial-gradient(circle, rgba(102,126,234,0.22) 0%, transparent 70%);
}
.auth-main::after {
    content: ''; position: absolute; bottom: -25%; left: -8%;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(52,211,153,0.14) 0%, transparent 70%);
}
.auth-wrap { position: relative; z-index: 2; max-width: 420px; margin: 0 auto; }

/* ===== 카드 ===== */
.auth-card {
    background: #fff; border-radius: 16px; padding: 34px 30px 28px;
    border: 1px solid #f0f0f0; box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}
.auth-card-head { text-align: center; margin-bottom: 22px; }
.auth-logo { height: 26px; width: auto; margin-bottom: 14px; }
.auth-title { font-size: 1.55rem; font-weight: 800; color: #1a1a2e; margin: 0 0 8px; }
.auth-sub { font-size: 0.87rem; color: #666; margin: 0; line-height: 1.6; }

/* ===== 오류 / 안내 ===== */
.auth-alert {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid #ef4444;
    border-radius: 0 10px 10px 0; padding: 13px 15px; margin-bottom: 18px;
}
.auth-alert i { color: #ef4444; font-size: 0.9rem; margin-top: 3px; flex-shrink: 0; }
.auth-alert p { margin: 0 0 4px; font-size: 0.85rem; color: #7f1d1d; line-height: 1.55; }
.auth-alert p:last-child { margin-bottom: 0; }
.auth-alert-info {
    background: #f0fdf4; border-color: #bbf7d0; border-left-color: #10b981;
}
.auth-alert-info i { color: #10b981; }
.auth-alert-info p { color: #14532d; }
.auth-alert-warn {
    background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b;
}
.auth-alert-warn i { color: #f59e0b; }
.auth-alert-warn p { color: #78350f; }

/* ===== 폼 ===== */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 0.8rem; font-weight: 700; color: #444; }
.auth-input {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1px solid #e5e7eb; border-radius: 10px;
    font-size: 0.92rem; color: #1a1a2e; background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-input::placeholder { color: #b6b6c2; }
.auth-input:focus {
    outline: none; border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.16);
}
.auth-pw { position: relative; display: block; }
.auth-pw .auth-input { padding-right: 46px; }
.auth-pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 9px; border: 0;
    background: transparent; color: #9a9aa6; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s ease;
}
.auth-pw-toggle:hover { color: #667eea; background: #f5f3ff; }

.auth-remember {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: #666; cursor: pointer; user-select: none;
}
.auth-remember input { width: 15px; height: 15px; accent-color: #667eea; cursor: pointer; }

.auth-submit {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; height: 48px; margin-top: 4px;
    border: 0; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: -0.2px;
    box-shadow: 0 8px 20px rgba(102,126,234,0.34);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(102,126,234,0.44); }
.auth-submit:active { transform: translateY(0); }
.auth-submit i { font-size: 0.85rem; }
.auth-submit[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* ===== 보조 링크 ===== */
.auth-links {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin-top: 20px; padding-top: 18px; border-top: 1px solid #f0f0f5;
    font-size: 0.8rem; color: #999;
}
.auth-links a { color: #666; text-decoration: none; font-weight: 600; }
.auth-links a:hover { color: #667eea; text-decoration: underline; }
.al-dot { color: #d8d8e0; }

.auth-foot-note {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 18px 4px 0; font-size: 0.76rem; line-height: 1.6;
    color: rgba(255,255,255,0.62);
}
.auth-foot-note i { margin-top: 2px; color: rgba(255,255,255,0.45); flex-shrink: 0; }

/* ===== 애니메이션 ===== */
.fade-up { opacity: 0; transform: translateY(20px); transition: all 0.5s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }


/* =====================================================================
   회원가입 (signup.php) — 넓은 2단 패널
   왼쪽: 입력 영역 / 오른쪽: 약관 동의 + 제출 (세로 길이 단축이 목적)
   ===================================================================== */
.auth-wrap-wide { max-width: 1000px; }
.auth-card-wide { padding: 24px 26px 20px; }

/* 카드 머리 + 구분 선택을 한 줄에 */
.auth-card-wide .auth-card-head { text-align: left; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #f0f0f5; }
.auth-card-wide .auth-logo { height: 20px; margin-bottom: 8px; }
.auth-card-wide .auth-title { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card-wide .auth-sub { font-size: 0.8rem; }

/* 개인/사업자 구분 바 (폼 안에 있어야 라디오가 제출된다) */
.auth-segbar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-bottom: 18px;
}

/* 조밀한 세그먼트 토글 (개인/사업자) */
.auth-seg { display: flex; gap: 4px; padding: 4px; background: #f2f2f8; border-radius: 12px; }
.auth-seg-opt { position: relative; display: block; cursor: pointer; }
.auth-seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.auth-seg-body {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 9px;
    font-size: 0.84rem; font-weight: 700; color: #6b6b7b; white-space: nowrap;
    transition: all 0.18s ease;
}
.auth-seg-body i { font-size: 0.86rem; }
.auth-seg-opt input:checked + .auth-seg-body {
    background: #fff; color: #5a4fc0; box-shadow: 0 2px 8px rgba(26,26,46,0.12);
}
.auth-seg-opt input:focus-visible + .auth-seg-body { outline: 2px solid #667eea; outline-offset: 2px; }
.auth-seg-note { font-size: 0.72rem; color: #9a9aa6; margin: 8px 2px 0; }

/* 2단 본체 */
.auth-cols {
    display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(268px, 0.85fr);
    gap: 26px; align-items: start;
}
.auth-side {
    position: sticky; top: 88px;
    background: #fafaff; border: 1px solid #ececf5; border-radius: 14px;
    padding: 18px 16px 16px;
}
.auth-side .auth-section { margin-top: 0; padding-top: 0; border-top: 0; }
.auth-side .auth-submit { margin-top: 16px; height: 46px; }

/* 섹션 — 구분선을 제목 옆 라인으로 없애고 간격만 */
.auth-section { margin-top: 20px; }
.auth-section:first-of-type { margin-top: 0; }
.auth-section-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.8rem; font-weight: 800; color: #1a1a2e; margin: 0 0 11px;
}
.auth-section-title i { color: #667eea; font-size: 0.78rem; }
.auth-section-title .sec-note { font-size: 0.7rem; font-weight: 600; color: #a5a5b2; margin-left: auto; }

/* 그리드: 기본 2열 / 짧은 항목은 3열 */
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.auth-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-field { gap: 5px; }
.auth-grid .span-2 { grid-column: 1 / -1; }
.auth-card-wide .auth-input { height: 42px; font-size: 0.88rem; padding: 0 12px; }
.auth-card-wide .auth-pw-toggle { width: 34px; height: 34px; }

.auth-label .req { color: #ef4444; margin-left: 3px; font-size: 0.76rem; }
.auth-label .opt {
    color: #a5a5b2; font-size: 0.68rem; font-weight: 600; margin-left: 5px;
}
.auth-hint { font-size: 0.7rem; color: #a5a5b2; line-height: 1.45; }
.auth-error {
    display: flex; align-items: flex-start; gap: 5px;
    font-size: 0.72rem; color: #b91c1c; line-height: 1.45;
}
.auth-error i { font-size: 0.66rem; margin-top: 3px; }
.auth-error[hidden] { display: none; }   /* JS 로 토글하는 클라이언트 오류 — display:flex 가 hidden 을 이긴다 */
.auth-input.is-error { border-color: #fca5a5; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

/* 타입 분기 영역 (JS 로 숨김 — display:none 은 탭 순서에서도 빠진다) */
.auth-only.is-hidden { display: none; }

/* 파일 업로드 한 줄 */
.auth-file {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border: 1px dashed #d9d9e6; border-radius: 10px; background: #fbfbfe;
}
.auth-file-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 8px; border: 1px solid #e5e7eb;
    background: #fff; color: #555; font-size: 0.76rem; font-weight: 700; cursor: pointer;
    transition: all 0.18s ease;
}
.auth-file-btn:hover { border-color: #667eea; color: #667eea; background: #f5f3ff; }
.auth-file input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.auth-file-name { font-size: 0.75rem; color: #77778a; word-break: break-all; }
.auth-file.is-error { border-color: #fca5a5; background: #fff5f5; }

/* 약관 — 오른쪽 패널에 조밀하게 */
.auth-terms { display: flex; flex-direction: column; gap: 9px; }
.auth-terms-all {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 10px; background: #efedfc; border: 1px solid #e0dcf8;
    font-size: 0.8rem; font-weight: 800; color: #1a1a2e; cursor: pointer;
}
.auth-terms-all input { width: 15px; height: 15px; accent-color: #667eea; }
.auth-check {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.78rem; color: #444; line-height: 1.5; cursor: pointer;
}
.auth-check input { width: 15px; height: 15px; margin-top: 2px; accent-color: #667eea; flex-shrink: 0; }
.auth-check .ck-label { flex: 1; }
.auth-check .ck-req { color: #ef4444; font-weight: 800; font-size: 0.68rem; margin-left: 4px; }
.auth-check .ck-opt { color: #a5a5b2; font-size: 0.68rem; margin-left: 4px; }
.auth-check a { color: #667eea; font-weight: 700; text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }
.auth-check.is-error { color: #b91c1c; }
.auth-check .auth-hint { display: block; margin-top: 1px; }

.auth-submit-note { font-size: 0.7rem; color: #9a9aa6; line-height: 1.55; margin: 10px 2px 0; }
.auth-card-wide .auth-links { margin-top: 18px; padding-top: 14px; }

/* ===== 반응형 ===== */
@media (max-width: 991px) {
    .auth-cols { grid-template-columns: 1fr; gap: 18px; }
    .auth-side { position: static; }
    .auth-wrap-wide { max-width: 620px; }
}
@media (max-width: 768px) {
    .auth-main { min-height: calc(100vh - 190px); padding: 30px 15px 46px; }
    .auth-card-wide { padding: 20px 16px 18px; }
    .auth-card-wide .auth-title { font-size: 1.2rem; }
    .auth-segbar { align-items: flex-start; }
}
@media (max-width: 640px) {
    .auth-grid { grid-template-columns: 1fr; }
    .auth-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-seg { width: 100%; }
    .auth-seg-body { flex: 1; justify-content: center; padding: 9px 10px; }
    .auth-file { flex-wrap: wrap; }
}
@media (max-width: 400px) {
    .auth-grid-3 { grid-template-columns: 1fr; }
}
