/* ==========================================
   로그인 페이지 전용 스타일 (login.css)
   이 파일은 account/login.html 에서만 로드됩니다.
   공통 스타일은 style.css 를 사용하세요.
   ========================================== */

/* ── 페이지 배경 ── */
.auth-section {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f6f9;           /* 아주 연한 중립 그레이 */
    padding: 5.5rem 1.5rem 3rem;
    position: relative;
}

/* 좌측 수직 액센트 바 (회계/SaaS 신뢰감) */
.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;
}

/* ── 컨테이너: 최대 너비 420px ── */
.auth-container {
    width: 100%;
    max-width: 420px;
    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;
}

/* ── 헤드라인: 24–28px ── */
.auth-headline {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

/* ── 서브텍스트: 14–15px ── */
.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;
}

/* ── 라벨 (14px) ── */
.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;               /* 접근성: 최소 터치 영역 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;                /* 접근성: 클릭 영역 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;
}

/* ── 필드 에러 메시지 ── */
.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;
}

/* ── 옵션 행: 로그인 유지 + 비밀번호 찾기 ── */
.form-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.1rem;
}

/* 체크박스 라벨 */
.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
    min-height: 44px;           /* 접근성 */
}

/* 커스텀 체크박스 */
.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.form-checkbox:hover:not(:checked) {
    border-color: #4338ca;
}

.form-checkbox:checked {
    background: #4338ca;
    border-color: #4338ca;
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.form-checkbox:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

/* 비밀번호 찾기 링크 */
.form-forgot-link {
    font-size: 0.855rem;
    color: #4338ca;
    font-weight: 500;
    transition: color 0.15s ease;
    white-space: nowrap;
    min-height: 44px;           /* 접근성 */
    display: flex;
    align-items: center;
}

.form-forgot-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

.form-forgot-link:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── 로그인 버튼 (메인 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.2rem;
}

.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); }
}

/* ── 회원가입 보조 CTA ── */
.auth-signup-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;
}

/* ── 모바일 반응형 ── */
@media (max-width: 540px) {
    .auth-card {
        padding: 2.25rem 1.5rem 2rem;
    }

    /* 소셜 버튼: 모바일에서 세로 배열 */
    .social-btn-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .form-options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .form-forgot-link {
        min-height: 36px;
    }
}

/* ─────────────────────────────────────────
   토스트 팝업 알림
───────────────────────────────────────── */

/* 토스트 컨테이너: 화면 우상단 고정 */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

/* 토스트 카드 */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 380px;
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.06);
    pointer-events: auto;

    /* 등장 애니메이션 초기값 */
    opacity: 0;
    transform: translateX(calc(100% + 1.5rem));
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 등장 */
.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* 퇴장 */
.toast.toast-hide {
    opacity: 0;
    transform: translateX(calc(100% + 1.5rem));
}

/* 아이콘 영역 */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #dc2626;
    margin-top: 1px;
}

/* 텍스트 영역 */
.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.855rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.45;
}

/* 닫기 버튼 */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
    margin-top: -2px;
}

.toast-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.toast-close:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

/* 진행 바 (자동 닫힘 타이머 시각화) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #dc2626;
    border-radius: 0 0 0 10px;
    animation: 토스트타이머 4s linear forwards;
}

.toast {
    position: relative;
    overflow: hidden;
}

@keyframes 토스트타이머 {
    from { width: 100%; }
    to   { width: 0%; }
}

/* 모바일: 전체 너비 */
@media (max-width: 480px) {
    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }
}
