/* ========================================
   인증 페이지 CSS (로그인, 회원가입, 비밀번호 찾기)
   login.html, signup.html, forgot-password.html
   ======================================== */

/* 로그인 컨테이너 */
.login-container {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    padding: 48px 40px;
    text-align: center;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.login-subtitle {
    font-size: 14px;
    color: #8d6e63;
    margin-bottom: 32px;
    line-height: 1.6;
}

.google-btn {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #5d4037;
    border-radius: 8px;
    background-color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    color: #5d4037;
    text-decoration: none;
}

.google-btn:hover {
    background-color: #5d4037;
    color: #fff;
}

.google-btn:hover svg path {
    fill: #fff;
}

.google-btn svg {
    width: 24px;
    height: 24px;
}

.info-box {
    margin-top: 32px;
    padding: 16px;
    background-color: #efebe9;
    border-radius: 8px;
    font-size: 13px;
    color: #5d4037;
    line-height: 1.6;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background-color: #ffebee;
    border-radius: 4px;
    color: #c62828;
    font-size: 14px;
    display: none;
}

/* 회원가입 컨테이너 */
.signup-container {
    width: 100%;
    max-width: 480px;
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    padding: 40px;
}

.signup-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.signup-subtitle {
    text-align: center;
    font-size: 14px;
    color: #8d6e63;
    margin-bottom: 32px;
}

/* 회원 유형 선택 */
.user-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.user-type-btn {
    flex: 1;
    padding: 16px;
    border: 2px solid #5d4037;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.user-type-btn:hover {
    background-color: #faf8f5;
}

.user-type-btn.active {
    background-color: #5d4037;
    color: #fff;
}

.user-type-btn .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.user-type-btn .label {
    font-size: 16px;
    font-weight: 600;
}

.user-type-btn .desc {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.8;
}

/* 입력 필드와 버튼 조합 */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.input-with-btn button {
    padding: 12px 16px;
    background-color: #fff;
    color: #5d4037;
    border: 1px solid #5d4037;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.input-with-btn button:hover {
    background-color: #5d4037;
    color: #fff;
}

.form-error {
    font-size: 12px;
    color: #e53935;
    margin-top: 6px;
    display: none;
}

/* 약관 동의 */
.terms-section {
    margin: 28px 0;
    padding: 20px;
    background-color: #faf8f5;
    border-radius: 8px;
}

.terms-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.terms-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.terms-item:last-child {
    margin-bottom: 0;
}

.terms-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #5d4037;
    cursor: pointer;
    margin-top: 1px;
}

.terms-item label {
    cursor: pointer;
    flex: 1;
}

.terms-item a {
    color: #5d4037;
    text-decoration: underline;
}

.terms-item.all-agree {
    padding-bottom: 12px;
    border-bottom: 1px solid #d7ccc8;
    margin-bottom: 16px;
    font-weight: 600;
}

.terms-item .optional {
    color: #8d6e63;
    font-size: 11px;
}

.signup-btn {
    width: 100%;
    padding: 14px;
    background-color: #5d4037;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.signup-btn:hover {
    background-color: #4e342e;
}

.signup-btn:disabled {
    background-color: #bcaaa4;
    cursor: not-allowed;
}

.login-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #8d6e63;
}

.login-link a {
    color: #5d4037;
    font-weight: 600;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 비밀번호 찾기 */
.forgot-container {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    padding: 40px;
}

.forgot-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.forgot-subtitle {
    text-align: center;
    font-size: 14px;
    color: #8d6e63;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* 탭 선택 */
.tab-selector {
    display: flex;
    border: 1px solid #5d4037;
    border-radius: 4px;
    margin-bottom: 28px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: #fff;
    color: #5d4037;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:first-child {
    border-right: 1px solid #5d4037;
}

.tab-btn.active {
    background-color: #5d4037;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: #5d4037;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.submit-btn:hover {
    background-color: #4e342e;
}

.back-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
}

.back-link a {
    color: #5d4037;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.back-link a:hover {
    text-decoration: underline;
}

/* 결과 메시지 */
.result-message {
    display: none;
    text-align: center;
    padding: 24px;
}

.result-message.show {
    display: block;
}

.result-message .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.result-message h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.result-message p {
    font-size: 14px;
    color: #8d6e63;
    line-height: 1.6;
}

/* 스피너 애니메이션 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* 구분선 */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #d7ccc8;
}

.divider span {
    padding: 0 16px;
    color: #8d6e63;
    font-size: 13px;
}

/* 테스트 로그인 폼 */
#testLoginForm {
    text-align: left;
}

#testLoginForm .input-group {
    margin-bottom: 16px;
}

#testLoginForm .input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #5d4037;
    margin-bottom: 6px;
}

#testLoginForm .input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7ccc8;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#testLoginForm .input-group input:focus {
    outline: none;
    border-color: #5d4037;
}

/* ========================================
   반응형 - 모바일 (768px 이하)
   ======================================== */
@media (max-width: 768px) {
    /* 로그인 컨테이너 */
    .login-container {
        margin: 20px 16px;
        padding: 32px 24px;
        max-width: none;
        width: auto;
    }

    .login-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }

    .login-title {
        font-size: 22px;
    }

    .login-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .google-btn {
        padding: 14px 16px;
        font-size: 15px;
    }

    .info-box {
        margin-top: 24px;
        padding: 14px;
        font-size: 12px;
    }

    /* 회원가입 컨테이너 */
    .signup-container {
        margin: 20px 16px;
        padding: 28px 20px;
        max-width: none;
        width: auto;
    }

    .signup-title {
        font-size: 22px;
    }

    .signup-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    /* 회원 유형 선택 */
    .user-type-selector {
        flex-direction: column;
        gap: 10px;
    }

    .user-type-btn {
        padding: 14px;
    }

    .user-type-btn .icon {
        font-size: 28px;
    }

    .user-type-btn .label {
        font-size: 15px;
    }

    /* 입력 필드 */
    .input-with-btn {
        flex-direction: column;
        gap: 8px;
    }

    .input-with-btn button {
        width: 100%;
        padding: 14px 16px;
    }

    /* 약관 동의 */
    .terms-section {
        margin: 24px 0;
        padding: 16px;
    }

    .terms-item {
        font-size: 13px;
    }

    .terms-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* 버튼 */
    .signup-btn,
    .submit-btn {
        padding: 16px;
        font-size: 16px;
    }

    /* 비밀번호 찾기 */
    .forgot-container {
        margin: 20px 16px;
        padding: 28px 20px;
        max-width: none;
        width: auto;
    }

    .forgot-title {
        font-size: 22px;
    }

    .forgot-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    /* 탭 선택 */
    .tab-btn {
        padding: 14px;
        font-size: 14px;
    }

    /* 테스트 계정 버튼 */
    .test-account-buttons {
        flex-wrap: wrap;
    }

    .test-account-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: calc(50% - 5px);
        padding: 14px 8px;
    }

    .test-account-btn .icon {
        font-size: 28px;
    }

    .test-account-btn .label {
        font-size: 13px;
    }
}

/* ========================================
   반응형 - 작은 모바일 (480px 이하)
   ======================================== */
@media (max-width: 480px) {
    .login-container {
        margin: 16px 12px;
        padding: 28px 20px;
    }

    .login-icon {
        width: 56px;
        height: 56px;
    }

    .login-title {
        font-size: 20px;
    }

    .signup-container {
        margin: 16px 12px;
        padding: 24px 16px;
    }

    .signup-title {
        font-size: 20px;
    }

    .user-type-btn {
        padding: 12px;
    }

    .user-type-btn .icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .user-type-btn .label {
        font-size: 14px;
    }

    .user-type-btn .desc {
        font-size: 11px;
    }

    .terms-section {
        padding: 14px;
    }

    .terms-title {
        font-size: 13px;
    }

    .terms-item {
        font-size: 12px;
        gap: 8px;
    }

    .forgot-container {
        margin: 16px 12px;
        padding: 24px 16px;
    }

    .forgot-title {
        font-size: 20px;
    }

    /* 테스트 계정 버튼 - 세로 배치 */
    .test-account-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .test-account-btn {
        flex: none;
        width: 100%;
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .test-account-btn .icon {
        font-size: 24px;
        margin-bottom: 0;
    }

    .test-account-btn .label {
        font-size: 14px;
    }
}

/* ========================================
   Safe Area 지원
   ======================================== */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .login-container,
        .signup-container,
        .forgot-container {
            margin-left: max(16px, env(safe-area-inset-left));
            margin-right: max(16px, env(safe-area-inset-right));
        }
    }
}
