/* ==========================================
   회원가입 페이지 전용 스타일 (signup.css)
   이 파일은 account/signup.html 에서만 로드됩니다.
   공통 인증 스타일(auth-card, form-input 등)은 style.css 를 사용하세요.
   ========================================== */

/* ── 페이지 배경 ── */
.auth-section {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f6f9;
    padding: 5.5rem 1.5rem 3rem;
    position: relative;
}

/* 좌측 수직 액센트 바 */
.auth-section::before {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #4338ca 0%, #6d28d9 100%);
    pointer-events: none;
}

/* ── 컨테이너: 회원가입은 좀 더 넓게 (480px) ── */
.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* ── 카드 ── */
.auth-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e5ea;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.05),
        0 8px 28px rgba(0, 0, 0, 0.07);
    padding: 2.75rem 2.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

/* 카드 상단 컬러 바 */
.auth-card-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4338ca 0%, #6d28d9 100%);
}

/* ── 로고 영역 ── */
.auth-logo-area {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 2rem;
}

.auth-logo-mark {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.auth-logo-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

/* ── 헤드라인 ── */
.auth-headline {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

/* ── 서브텍스트 ── */
.auth-subtext {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

/* ── 전체 오류 알림 ── */
.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.form-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #dc2626;
}

/* ── 폼 레이아웃 ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

/* ── 라벨 ── */
.form-label {
    font-size: 0.855rem;
    font-weight: 600;
    color: #374151;
    display: block;
}

/* ── 입력 래퍼 ── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ── 입력 필드 ── */
.form-input {
    width: 100%;
    height: 44px;
    padding: 0 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.93rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* 오른쪽 아이콘 여백 (비밀번호) */
.form-input.has-icon {
    padding-right: 2.85rem;
}

/* 호버 */
.form-input:not(:focus):not(.is-error):not(:disabled):hover {
    border-color: #9ca3af;
}

/* 포커스 — 접근성 포커스 링 */
.form-input:focus {
    border-color: #4338ca;
    background: #fafbff;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}

/* 에러 */
.form-input.is-error {
    border-color: #dc2626;
    background: #fffbfb;
}

.form-input.is-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.11);
}

/* 비활성 */
.form-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* ── 비밀번호 눈 토글 버튼 ── */
.btn-eye-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s ease;
    border-radius: 0 8px 8px 0;
    padding: 0;
}

.btn-eye-toggle:hover {
    color: #4338ca;
}

.btn-eye-toggle:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: -2px;
    border-radius: 0 8px 8px 0;
}

/* ── 필드 에러 메시지 ── */
.field-error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.1rem;
    line-height: 1.4;
}

.field-error svg {
    flex-shrink: 0;
}

/* ── 비밀번호 강도 표시 바 ── */
.password-strength-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.strength-bar-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* 강도 단계별 색상 */
.strength-bar-fill.strength-empty    { width: 0%;   background: transparent; }
.strength-bar-fill.strength-weak     { width: 25%;  background: #ef4444; }
.strength-bar-fill.strength-fair     { width: 50%;  background: #f97316; }
.strength-bar-fill.strength-good     { width: 75%;  background: #eab308; }
.strength-bar-fill.strength-strong   { width: 100%; background: #22c55e; }

.strength-label {
    font-size: 0.775rem;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.strength-label.strength-weak     { color: #ef4444; }
.strength-label.strength-fair     { color: #f97316; }
.strength-label.strength-good     { color: #eab308; }
.strength-label.strength-strong   { color: #22c55e; }

/* ── 비밀번호 일치 표시 ── */
.password-match-msg {
    font-size: 0.78rem;
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.2rem;
}

.password-match-msg.match-ok {
    color: #16a34a;
}

.password-match-msg.match-fail {
    color: #dc2626;
}

/* ── 도움말 텍스트 (비밀번호 규칙 등) ── */
.form-helptext {
    font-size: 0.775rem;
    color: #9ca3af;
    line-height: 1.55;
    margin-top: 0.15rem;
}

/* ── 회원가입 버튼 (메인 CTA) ── */
.btn-cta-primary {
    width: 100%;
    height: 46px;
    background: #4338ca;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.97rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    margin-top: 0.4rem;
}

.btn-cta-primary:hover {
    background: #3730a3;
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.38);
}

.btn-cta-primary:active {
    transform: scale(0.99);
    box-shadow: none;
}

.btn-cta-primary:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 3px;
}

.btn-cta-primary:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 로딩 스피너 */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: 스피너회전 0.7s linear infinite;
    display: none;
    flex-shrink: 0;
}

@keyframes 스피너회전 {
    to { transform: rotate(360deg); }
}

/* ── 로그인 보조 링크 ── */
.auth-login-row {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.btn-cta-text {
    color: #4338ca;
    font-weight: 600;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
    padding: 0;
}

.btn-cta-text:hover {
    color: #3730a3;
    text-decoration: underline;
}

.btn-cta-text:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── 구분선 "또는" ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.5rem 0 1.25rem;
    color: #9ca3af;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── 소셜 버튼 2개 ── */
.social-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    height: 44px;
    border: 1.5px solid #e2e5ea;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn-social:hover {
    background: #f9fafb;
    border-color: #b0b7c3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.btn-social:active {
    background: #f3f4f6;
    box-shadow: none;
}

.btn-social:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

/* 카카오 버튼 (공식 가이드라인: 배경 #FEE500, 텍스트 #3C1E1E) */
.btn-social-kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #3C1E1E;
}

.btn-social-kakao:hover {
    background: #F0D900;
    border-color: #F0D900;
    box-shadow: 0 2px 8px rgba(254, 229, 0, 0.45);
}

.btn-social-kakao:active {
    background: #E6CF00;
    box-shadow: none;
}

/* ── 이용약관 동의 안내 ── */
.auth-terms {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f2f5;
    font-size: 0.775rem;
    color: #9ca3af;
    line-height: 1.65;
}

.auth-terms a {
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.auth-terms a:hover {
    color: #4338ca;
}

/* ── 페이드인 애니메이션 ── */
@keyframes 페이드인위로 {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: 페이드인위로 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── 모바일 반응형 ── */
@media (max-width: 540px) {
    .auth-card {
        padding: 2.25rem 1.5rem 2rem;
    }

    /* 소셜 버튼: 세로 배열 */
    .social-btn-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .auth-headline {
        font-size: 1.5rem;
    }
}
