/* 인증 페이지 스타일 (로그인/회원가입) - 메인 페이지와 톤 통일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

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

.auth-header {
    background: #3d4957;
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
    border-bottom: 3px solid #2c3640;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

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

.auth-form {
    padding: 40px 30px 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #3d4957;
    margin-bottom: 8px;
}

.form-group label .required {
    color: #e74c3c;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus {
    border-color: #3d4957;
    box-shadow: 0 0 0 3px rgba(61, 73, 87, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group input:disabled {
    background-color: #f5f5f5;
    color: #888;
}

.input-with-icon {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background-color: rgba(61, 73, 87, 0.1);
}

.password-toggle:focus {
    outline: 2px solid #3d4957;
    outline-offset: 2px;
}

.eye-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
}

.eye-icon.eye-closed path {
    opacity: 0.5;
}

.form-text {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.error-message {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.success-message {
    background-color: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: #3d4957;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-primary:hover:not(:disabled) {
    background: #2c3640;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 73, 87, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #3d4957;
    background: white;
    border: 2px solid #3d4957;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) {
    background: #3d4957;
    color: white;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.auth-footer {
    padding: 20px 30px 30px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.auth-footer p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

.auth-footer a {
    color: #3d4957;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #2c3640;
    text-decoration: underline;
}

/* 인증 코드 입력 영역 */
#verificationGroup {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

#codeTimer {
    color: #3d4957;
    font-weight: 600;
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* 모바일 확대 방지 */
    }

    .auth-container {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .auth-card {
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }
    
    .auth-header {
        padding: 25px 20px 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 13px;
    }
    
    .auth-form {
        padding: 25px 20px 20px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 12px 40px 12px 14px;
        font-size: 16px; /* 모바일 확대 방지 */
        border-radius: 8px;
    }

    .password-toggle {
        right: 10px;
    }

    .eye-icon {
        width: 18px;
        height: 18px;
    }
    
    .form-text {
        font-size: 11px;
        margin-top: 4px;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 6px;
        width: 100%;
        margin-top: 8px;
    }
    
    .error-message,
    .success-message {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .auth-footer {
        padding: 15px 20px 20px;
    }
    
    .auth-footer p {
        font-size: 13px;
        margin: 6px 0;
    }
    
    #verificationGroup {
        padding: 15px;
        border-radius: 10px;
    }
    
    #codeTimer {
        font-size: 11px;
    }
}

/* 이메일 입력 그룹 - 모바일 최적화 */
.email-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-input-group input {
    width: 100%;
}

.email-input-group .btn-secondary {
    align-self: flex-start;
}

/* 데스크탑에서는 가로 배치 */
@media (min-width: 769px) {
    .email-input-group {
        flex-direction: row;
    }

    .email-input-group input {
        flex: 1;
    }

    .email-input-group .btn-secondary {
        align-self: auto;
        width: auto;
    }
}

@media (max-width: 480px) {
    .auth-header h1 {
        font-size: 22px;
    }

    .form-group input {
        padding: 11px 12px;
        font-size: 13px;
    }

    .btn-primary {
        padding: 13px;
        font-size: 13px;
    }
}
