/* 인증 관련 스타일 */

.auth-container {
    min-height: 100vh;
    /* 청바지 패턴 배경 */
    background-color: #4a6fa5;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,.05) 2px, rgba(255,255,255,.05) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px),
        repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0px, transparent 1px, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 3px, transparent 3px, transparent 4px),
        linear-gradient(135deg, #4a6fa5 0%, #5b7fb8 25%, #4a6fa5 50%, #3d5f8f 75%, #4a6fa5 100%);
    background-size: 100% 100%, 100% 100%, 8px 8px, 100% 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 헤더 스타일 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-top: env(safe-area-inset-top, 0);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* 햄버거 메뉴 버튼 */
.hamburger-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.hamburger-menu-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.hamburger-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 햄버거 메뉴 */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.hamburger-menu::-webkit-scrollbar {
    width: 6px;
}

.hamburger-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.hamburger-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.hamburger-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.hamburger-menu.open {
    right: 0;
}

.menu-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.menu-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-content {
    padding: 1rem 0;
}

.menu-section {
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.menu-section h4 {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: none;
    border: none;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.menu-item:hover {
    background: #f8f9fa;
    color: #667eea;
    transform: translateX(5px);
}

.menu-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: #667eea;
}

.menu-item.active {
    background: #f0f4ff;
    color: #667eea;
    font-weight: 600;
}

/* 인증 카드 컨테이너 */
.auth-content-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    padding-top: calc(2rem + 60px + env(safe-area-inset-top, 0)); /* 헤더 높이 + safe area */
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
    margin: 0 auto;
    box-sizing: border-box;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #333;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header h1 i {
    margin-right: 0.5rem;
    color: #667eea;
}

.auth-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.auth-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
    scroll-margin-top: calc(80px + env(safe-area-inset-top, 0));
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 로그인 메일 인증코드 입력 */
.login-code-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 5:5 */
    gap: 10px;
    align-items: stretch;
}

.login-code-input {
    width: 100%;
    min-width: 0; /* Android/WebView에서 grid overflow 방지 */
}

.login-code-send-btn {
    white-space: nowrap;
    width: 100%;
    justify-content: center;
}

.login-code-help {
    display: block;
    margin-top: 6px;
    color: #666;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.field-error {
    margin-top: 0.25rem;
    color: #dc3545;
    font-size: 0.8rem;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.auth-footer p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-account-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.test-account-info h4 {
    margin: 0 0 0.5rem 0;
    color: #1976d2;
    font-size: 0.9rem;
    font-weight: 600;
}

.test-account-info h4 i {
    margin-right: 0.25rem;
}

.test-account-info p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: #424242;
}

.test-account-info strong {
    color: #1976d2;
}

/* 토스트 메시지 */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 2000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 350px;
    min-width: 250px;
}

.toast-message.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-message::before {
    content: '';
    width: 4px;
    height: 100%;
    border-radius: 2px;
    position: absolute;
    left: 0;
    top: 0;
}

.toast-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.toast-success::before {
    background: #1e7e34;
}

.toast-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast-error::before {
    background: #c82333;
}

.toast-info {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.toast-info::before {
    background: #0056b3;
}

.toast-message i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message span {
    flex: 1;
    line-height: 1.4;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-content {
        padding: 1rem 1.5rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .auth-content-wrapper {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
        border-radius: 15px;
    }
    
    .auth-header h1 {
        font-size: 1.4rem;
    }
    
    .form-group input {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    /* 모바일에서 인증코드 인풋/버튼 더 크게 */
    .login-code-input {
        padding: 1.05rem 1rem;
        font-size: 1.05rem;
        border-radius: 12px;
    }

    .login-code-send-btn {
        padding: 1.05rem 1rem;
        font-size: 0.98rem;
        border-radius: 12px;
    }
    
    .btn-full {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .hamburger-menu {
        width: 100%;
        right: -100%;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .hamburger-menu.open {
        right: 0;
    }
    
    .toast-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        transform: translateY(-100px);
    }
    
    .toast-message.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.2rem;
    }
    
    .form-group input {
        font-size: 0.9rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
