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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', 'Inter', sans-serif;
    height: 100vh;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


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


/* 중앙 카드 컨테이너 */
.card-container {
    width: 100%;
    max-width: 500px;
    position: relative;
}

/* 로그인 카드 */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 닫기 버튼 */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #666666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background: transparent;
    color: #333333;
}

/* 다크모드 토글 버튼 */
.dark-mode-toggle-wrapper {
    position: fixed;
    top: 20px;
    right: 100px;
    z-index: 100;
}

.dark-mode-toggle {
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 32px;
}

.toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: #E5E7EB;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* body에 dark-mode 클래스가 있으면 초기 상태를 다크모드로 설정 (깜빡임 방지) */
html.dark-mode .toggle-track {
    background: #374151;
}

.dark-mode-toggle.dark-mode-active .toggle-track {
    background: #374151;
}

.toggle-knob {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #9CA3AF;
    transition: left 0.3s ease, background 0.3s ease;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* body에 dark-mode 클래스가 있으면 초기 상태를 다크모드로 설정 (깜빡임 방지) */
html.dark-mode .toggle-knob {
    left: calc(100% - 30px);
    background: #ffffff;
}

.dark-mode-toggle.dark-mode-active .toggle-knob {
    left: calc(100% - 30px);
    background: #ffffff;
}

.toggle-icon-dark,
.toggle-icon-light {
    position: absolute;
    font-size: 14px;
    transition: opacity 0.3s ease, color 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon-dark {
    left: 8px;
    color: #6B7280;
    opacity: 0;
}

.toggle-icon-dark i {
    color: inherit;
}

.toggle-icon-light {
    right: 8px;
    color: #F59E0B;
    opacity: 1;
}

.toggle-icon-light i {
    color: inherit;
}

/* body에 dark-mode 클래스가 있으면 초기 상태를 다크모드로 설정 (깜빡임 방지) */
html.dark-mode .toggle-icon-dark {
    opacity: 1;
    color: #ffffff;
}

html.dark-mode .toggle-icon-dark i {
    color: #ffffff;
}

html.dark-mode .toggle-icon-light {
    opacity: 0;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-dark {
    opacity: 1;
    color: #ffffff;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-dark i {
    color: #ffffff;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-light {
    opacity: 0;
}

.dark-mode-toggle:hover .toggle-track {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle:hover {
    transform: none;
}

/* 언어 선택기 (카드 밖) */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
    background: #ffffff;
    z-index: 100;
    transition: all 0.2s;
}

.logo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #1F2937;
    font-size: 28px;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 30px;
}

.logo-btn .logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.language-selector:hover {
    background: #f5f5f5;
    border-color: #4f46e5;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    display: none;
    z-index: 100;
    overflow: hidden;
}

.language-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.language-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.language-option:hover {
    background: #f5f5f5;
}

.language-option.active {
    background: #f0f7ff;
    color: #4f46e5;
    font-weight: 600;
}

.login-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.welcome-title {
    font-size: 26px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 8px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 16px;
    color: #999999;
    margin-bottom: 40px;
    text-align: center;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    width: 100%;
    padding: 16px 20px;
    min-height: 56px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.social-btn > span {
    flex: 1;
    text-align: center;
}

.social-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.social-btn.google {
    border-color: #e0e0e0;
}

.social-btn.kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #000000;
}

.social-btn.kakao:hover {
    background: #FDD835;
    border-color: #FDD835;
}

.social-btn.naver {
    background: #03C75A;
    border-color: #03C75A;
    color: #ffffff;
}

.social-btn.naver:hover {
    background: #02B350;
    border-color: #02B350;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    position: absolute;
    left: 20px;
}

.social-btn.google .social-icon {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.social-btn.kakao .social-icon {
    background: transparent;
    border: none;
    padding: 0;
}

.social-btn.naver .social-icon {
    background: transparent;
    border: none;
    padding: 0;
}

.social-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.social-btn.naver .social-icon-img {
    border-radius: 0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #999999;
    font-size: 14px;
}

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

.divider span {
    padding: 0 16px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    color: #333333;
    font-weight: 500;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.email-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #ffffff;
}

.password-input-wrapper .email-input {
    padding-right: 45px;
}

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

.password-toggle:hover {
    color: #666666;
}

.email-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.email-input.error {
    border-color: #ff6b6b;
}

.email-input.error:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.email-input::placeholder {
    color: #999999;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: -12px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.continue-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.continue-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.guest-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #4f46e5;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.guest-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.guest-btn:active {
    transform: translateY(0);
}

.continue-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.social-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    font-size: 14px;
}

.footer-link {
    color: #999999;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #4f46e5;
}

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

.signup-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #999999;
}

.signup-link a {
    color: #667EEA;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.signup-link a:hover {
    color: #4f46e5;
}

/* 성공 메시지 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: slideInRight 0.3s ease;
}

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

.success-message.error {
    background: #f44336;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 다크모드 스타일 - 기본 배경은 파일 하단에서 정의 */

/* 다크모드 - 로고 */

html.dark-mode .welcome-title {
    color: #E5E7EB;
}

html.dark-mode .welcome-subtitle {
    color: #9CA3AF;
}

html.dark-mode .email-input {
    background: #374151;
    border-color: #4B5563;
    color: #E5E7EB;
}

html.dark-mode .email-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html.dark-mode .email-input::placeholder {
    color: #9CA3AF;
}

html.dark-mode .social-btn {
    background: #374151;
    border-color: #4B5563;
    color: #E5E7EB;
    border-radius: 8px;
}

html.dark-mode .social-btn:hover {
    background: #4B5563;
    border-color: #6B7280;
}

/* 다크모드 - 구글 버튼 하얀색 */
html.dark-mode .social-btn.google {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    color: #333333 !important;
}

html.dark-mode .social-btn.google:hover {
    background: #f5f5f5 !important;
    border-color: #d0d0d0 !important;
}

html.dark-mode .social-btn.google > span {
    color: #333333 !important;
}

/* 다크모드 - 구글 로고 원래 색상 유지 (하얀 배경에 맞춤) */
html.dark-mode .social-btn.google .social-icon svg {
    filter: none;
}

html.dark-mode .social-btn.kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #000000;
}

html.dark-mode .social-btn.naver {
    background: #03C75A;
    border-color: #03C75A;
    color: #ffffff;
}

html.dark-mode .divider {
    color: #9CA3AF;
}

html.dark-mode .divider::before,
html.dark-mode .divider::after {
    background: #4B5563;
}

html.dark-mode .signup-link {
    color: #9CA3AF;
}

html.dark-mode .signup-link a {
    color: #9CA3AF;
}

html.dark-mode .signup-link a:hover {
    color: #6366f1;
}

html.dark-mode .language-selector {
    background: #374151;
    border-color: #4B5563;
    color: #E5E7EB;
}

html.dark-mode .language-selector:hover {
    background: #4B5563;
    border-color: #6366f1;
}

html.dark-mode .language-dropdown {
    background: #374151;
    border-color: #4B5563;
}

html.dark-mode .language-option {
    color: #E5E7EB;
}

html.dark-mode .language-option:hover {
    background: #4B5563;
}

html.dark-mode .language-option.active {
    background: #1E3A8A;
    color: #E5E7EB;
}

html.dark-mode .close-btn {
    color: #9CA3AF;
}

html.dark-mode .close-btn:hover {
    color: #E5E7EB;
}

html.dark-mode .password-toggle {
    color: #9CA3AF;
}

html.dark-mode .password-toggle:hover {
    color: #E5E7EB;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .login-card {
        padding: 30px 20px;
    }

    .welcome-title {
        font-size: 24px;
    }

    .language-selector {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .dark-mode-toggle-wrapper {
        top: 10px;
        right: 80px;
    }
}

/* ===== 다크모드 스타일 ===== */
html.dark-mode,
html.dark-mode body {
    background: rgb(32, 33, 37);
    color: #e2e8f0;
}

html.dark-mode .card-container,
html.dark-mode .login-card {
    background: rgb(42, 43, 48);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

html.dark-mode .login-title {
    color: #e2e8f0;
}

html.dark-mode .login-subtitle {
    color: #9ca3af;
}

html.dark-mode .input-field {
    background: rgb(32, 33, 37);
    border-color: #4a4a4a;
    color: #e2e8f0;
    border-radius: 8px;
}

html.dark-mode .input-field:focus {
    border-color: #667eea;
}

html.dark-mode .input-field::placeholder {
    color: #6b7280;
}

html.dark-mode .divider-text {
    color: #6b7280;
    background: rgb(42, 43, 48);
}

html.dark-mode .divider-line {
    background: #4a4a4a;
}

html.dark-mode .signup-link,
html.dark-mode .find-password-link {
    color: #9ca3af;
}

html.dark-mode .signup-link a,
html.dark-mode .find-password-link a {
    color: #667eea;
}

html.dark-mode .back-link {
    color: #9ca3af;
}

html.dark-mode .back-link:hover {
    color: #e2e8f0;
}

