/**
 * 인증 페이지 통합 스타일 (로그인, 회원가입)
 * 중복 제거 및 최적화 버전
 */

/* CSS 변수는 common.css에서 통합 관리됩니다 */

/* ===== 기본 레이아웃 ===== */
.auth-section {
    padding: 120px 0 60px 0;
    background-color: var(--bg-light);
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 통합 컨테이너 스타일 */
.auth-container {
    width: 100%;
    min-width: 600px;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 50px;
}

/* 컨테이너 크기 변형 */
.auth-container.login-container {
    max-width: 500px;
}

.auth-container.signup-container {
    min-width: 900px;
    padding: 60px;
}

/* ===== 헤더 스타일 ===== */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 18px;
}

/* ===== 폼 스타일 ===== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group .required {
    color: var(--error-color);
    margin-left: 2px;
}

/* 통합 입력 필드 스타일 */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.form-group input.error {
    border-color: var(--error-color);
}

.form-group input.success {
    border-color: var(--success-color);
}

.form-group input::placeholder {
    font-size: 14px;
    color: var(--text-muted);
}

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

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

.input-with-btn .check-btn {
    flex-shrink: 0;
    min-width: 100px;
    padding: 0 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.input-with-btn .check-btn:hover {
    background-color: var(--primary-hover);
}

.input-with-btn .check-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ===== 메시지 스타일 ===== */
.form-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

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

.success-message {
    color: var(--success-color);
    font-size: 14px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

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

/* ===== 소셜 로그인 ===== */
.social-signup-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.social-signup-intro {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.social-btn img {
    width: 28px;
    height: 28px;
    margin-right: 12px;
}

.social-btn.kakao {
    background-color: #ffeb00;
    color: #000;
}

.social-btn.naver {
    background-color: #1fc800;
    color: #fff;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== 구분선 ===== */
.signup-divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.signup-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-light);
}

.signup-divider span {
    position: relative;
    background-color: var(--bg-white);
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== 회원 구분 선택 ===== */
.member-type-selection {
    margin: 30px 0;
}

.member-type-title {
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
}

.member-type-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.member-type-option {
    cursor: pointer;
}

.member-type-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.option-content:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.02);
}

.member-type-option input[type="radio"]:checked + .option-content {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.08);
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.15);
}

.option-icon {
    font-size: 28px;
    margin-right: 18px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f4ff;
    border-radius: var(--radius-full);
}

.option-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.option-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== 약관 동의 ===== */
.terms-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-light);
}

.terms-all {
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
}

.terms-all label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
}

.terms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 10px;
}

.terms-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.terms-item:last-child {
    border-bottom: none;
}

.terms-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.terms-container input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.terms-link {
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.terms-link:hover {
    background-color: rgba(74, 108, 247, 0.1);
    text-decoration: none;
}

/* ===== 버튼 스타일 ===== */
.btn-auth,
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(74, 108, 247, 0.3);
}

.btn-auth:hover,
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-auth:active,
.btn-login:active {
    transform: translateY(0);
}

.btn-auth:disabled,
.btn-login:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== 로그인 페이지 전용 ===== */
.success-message-box {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: var(--radius-lg);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/*
.success-icon {
    width: 40px;
    height: 40px;
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.success-text h4 {

    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.success-text p {
    color: #155724;
    margin: 0;
    font-size: 14px;
}
*/
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark:after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.label-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.find-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.find-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.find-link:hover {
    color: var(--primary-color);
}

.divider {
    color: #ccc;
    font-size: 12px;
}

/* ===== 회원가입 페이지 전용 ===== */
.signup-fields {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.signup-fields .form-group {
    margin-bottom: 0px;
    position: relative;
}

#smsVerifyGroup {
    margin-top: 15px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.sms-timer {
    font-size: 14px;
    color: var(--error-color);
    margin-top: 8px;
    font-weight: 500;
}

/* ===== 모달 ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.close-modal:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.modal h3 {
    margin-bottom: 30px;
    font-size: 24px;
    color: var(--text-primary);
    padding-right: 50px;
}

.modal h4 {
    margin: 25px 0 10px 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.modal p {
    margin: 8px 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ===== 푸터 ===== */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== 반응형 디자인 ===== */

/* 태블릿 */
@media (max-width: 1024px) {
    .auth-container.signup-container {
        min-width: 700px;
        max-width: 800px;
        padding: 50px 40px;
    }

    .member-type-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 일반 태블릿 */
@media (max-width: 992px) {
    .auth-container {
        max-width: 90%;
        padding: 40px 30px;
    }
}

/* 모바일 */
@media (max-width: 768px) {
    .auth-section {
        padding: 40px 20px;
    }

    .auth-container {
        width: 100%;
        min-width: 600px;
        padding: 35px 25px;
        margin: 0;
        border-radius: var(--radius-lg);
    }

    .auth-container.signup-container {
        min-width: 600px;
        padding: 40px 30px;
    }

    .auth-header h2 {
        font-size: 26px;
    }

    .auth-header p {
        font-size: 16px;
    }

    .social-signup-intro {
        font-size: 16px;
    }

    .social-btn {
        padding: 12px;
        font-size: 14px;
    }

    .option-content {
        padding: 13px;
    }

    .option-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .option-info h4 {
        font-size: 15px;
    }

    .option-info p {
        font-size: 13px;
    }

    .btn-auth,
    .btn-login {
        padding: 16px;
        font-size: 16px;
    }

    .modal-content {
        padding: 30px 25px;
        width: 95%;
        max-width: 95%;
    }

    .input-with-btn {
        flex-direction: row;
        gap: 10px;
    }

    .input-with-btn .check-btn {
        min-width: 100px;
        padding: 0 12px;
        font-size: 13px;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .find-links {
        align-self: flex-end;
    }
}

/* 작은 모바일 */
@media (max-width: 480px) {
    .auth-section {
        padding: 20px 0;
    }

    .auth-container {
        width: 90%;
        min-width: 390px;
        padding: 30px 20px;
        border-radius: var(--radius-md);
        margin: 0 auto;
    }

    .auth-container.login-container {
        min-width: 350px;
        padding: 30px 20px;
    }

    .auth-container.signup-container {
        min-width: 390px;
        padding: 30px 20px;
    }

    .auth-header h2 {
        font-size: 24px;
    }

    .auth-header p {
        font-size: 15px;
    }

    .social-btn {
        padding: 12px;
        font-size: 15px;
    }

    .social-btn img {
        width: 22px;
        height: 22px;
    }

    .option-content {
        padding: 12px;
    }

    .option-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
        margin-right: 12px;
    }

    .option-info h4 {
        font-size: 14px;
    }

    .option-info p {
        font-size: 12px;
    }

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

    .terms-item label,
    .terms-link {
        font-size: 14px;
    }

    .btn-auth,
    .btn-login {
        padding: 14px;
        font-size: 16px;
    }

    .success-message-box {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }

    .success-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .login-options {
        align-items: center;
    }

    .find-links {
        align-self: center;
    }

        .input-with-btn .check-btn {
            min-width: 80px;
            padding: 0 8px;
            font-size: 12px;
        }

}

/* 초소형 모바일 */
@media (max-width: 420px) {
    .auth-container {
        width: 95%;
        min-width: 380px;
        padding: 25px 15px;
    }

    .auth-container.login-container {
        min-width: 350px;
    }

    .auth-container.signup-container {
        min-width: 350px;
        padding: 25px 15px;
    }

    .social-btn {
        padding: 12px;
    }

    .option-content {
        padding: 10px;
    }

    .auth-header h2 {
        font-size: 22px;
    }
}

@media (max-width: 375px) {
    .auth-container {
        min-width: 350px;
    }

    .auth-container.login-container {
        min-width: 320px;
    }

    .auth-container.signup-container {
        min-width: 320px;
    }
}

/* 최소 화면 */
@media (max-width: 320px) {
    .auth-section {
        padding: 5px 5px 20px 5px;
    }

    .auth-container {
        width: 98%;
        min-width: 300px;
        padding: 20px 12px;
    }

    .auth-container.login-container {
        min-width: 300px;
    }

    .auth-container.signup-container {
        min-width: 300px;
        padding: 20px 12px;
    }

    .auth-header h2 {
        font-size: 20px;
    }

    .social-btn {
        padding: 10px;
        font-size: 14px;
    }

    .option-content {
        padding: 8px;
    }

    .option-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
        margin-right: 10px;
    }
}

/* 뷰포트 설정 */
@viewport {
    width: device-width;
    zoom: 1.0;
}

/* 가로 스크롤 방지 */
html, body {
    overflow-x: hidden;
    width: 100%;
}
