:root {
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --input-height: 48px;
    /* 이 값들은 PHP에서 동적으로 덮어쓰여지는 기본값입니다. */
    --brand-name: 'WassupVpn';
    --logo-font-size: 24px;
    --logo-image-url: url('');
    --logo-image-width: 200px;
    --logo-image-height: 80px;
    --primary-color: #111111;
    --primary-text-color: #FFFFFF;
    --background-light: #FFFFFF;
    --background-dark: #F7F7F8;
    --border-color: #E5E7EB;
    --text-color-primary: #111827;
    --text-color-secondary: #6B7280;
    --form-max-width: 400px;
    --border-radius: 8px;
}
/* --- 기본 설정 --- */
body.login {font-family: var(--font-family);}
#login {padding: 0 !important; width: 90%; max-width: var(--form-max-width);}

/* --- 로고 스타일 --- */
#login h1 {text-align: center; margin-bottom: 0;}
#login h1 a {display: inline-block;}
.logo-type-text #login h1::before {content: var(--brand-name); color: var(--text-color-primary); font-size: var(--logo-font-size); font-weight: 600; margin-bottom: 24px; display: block;}
.logo-type-text #login h1 a {display: none;}
.logo-type-image #login h1::before {display: none;}
.logo-type-image #login h1 a {display: block !important; background-image: var(--logo-image-url); background-size: contain; background-position: center; background-repeat: no-repeat; width: var(--logo-image-width); height: var(--logo-image-height); margin: 0 auto 24px; text-indent: -9999px;}

/* --- 폼 스타일 --- */
#login p.message, .login #login_error {border: 1px solid #ef4444; background: #fef2f2; color: #991b1b; border-radius: var(--border-radius); box-shadow: none;}
#login_error a {color: #991b1b; font-weight: bold;}
#loginform {background: transparent; border: none; box-shadow: none; margin-top: 0; padding: 0;}
#login form p {margin-bottom: 16px;}
#login form label {font-size: 14px; color: var(--text-color-secondary); font-weight: 500; margin-bottom: 8px; display: block;}
#login form .input, #login input[type="text"], #login input[type="password"] {width: 100%; background-color: var(--background-light); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: none; padding: 0 12px; height: var(--input-height); font-size: 16px !important; color: var(--text-color-primary);}
#login input:focus {box-shadow: 0 0 0 2px var(--primary-color) inset; border-color: var(--primary-color);}
.user-pass-wrap {position: relative;}
.wp-pwd .button.wp-hide-pw {position: absolute; right: 1px; top: 1px; bottom: 1px; width: var(--input-height); height: var(--input-height); border: none; background: transparent; cursor: pointer;}
.wp-pwd .button.wp-hide-pw .dashicons {color: var(--text-color-secondary);}
#login form p.forgetmenot {display: flex; justify-content: flex-start; align-items: center; margin-bottom: 20px !important;}
#login form .forgetmenot label {margin-left: 8px; margin-bottom: 0;}

/* --- 버튼 스타일 --- */
.wp-core-ui .button-primary {width: 100%; height: var(--input-height); background-color: var(--primary-color); color: var(--primary-text-color); border: none; border-radius: var(--border-radius); font-weight: bold; text-shadow: none; transition: background-color 0.2s;}
.wp-core-ui .button-primary:hover {opacity: 0.9;}
#login form p.submit {margin-bottom: 12px;}

/* --- 버튼 간격 조정 --- */
#loginform .signup-button-container {
    margin-top: 16px;
    margin-bottom: 12px;
}

#loginform .kakao-shortcode-container {
    margin-bottom: 12px;
}

/* --- 카카오 로그인 버튼 컨테이너 및 신규 버튼 스타일 --- */
.kakao-shortcode-container {margin-top: 16px; width: 100%;}
.wcl-responsive-kakao-button {display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; text-decoration: none; font-size: 15px; font-weight: 500; border-radius: var(--border-radius) !important; background-color: #FEE500; color: #191919; border: none; box-shadow: none; transition: opacity 0.2s;}
.wcl-responsive-kakao-button:hover {opacity: 0.9;}
.wcl-responsive-kakao-button svg {fill: #191919;}

/* --- 하단 링크 --- */
#login #nav, #login #backtoblog {margin: 16px 0 0; padding: 0; text-align: center;}
#login #nav a, #login #backtoblog a {color: var(--text-color-secondary); font-size: 14px;}
#login #nav a:hover, #login #backtoblog a:hover {color: var(--primary-color);}

/* --- 배경 비디오 --- */
#login-bg-video {position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 100%; min-height: 100%; width: auto; height: auto; object-fit: cover; z-index: -1;}

/* --- 모바일 화면 --- */
@media (max-width: 1023px) {
    body.login {display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; box-sizing: border-box;}
    #login {background: var(--background-light); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 40px 25px !important; box-shadow: 0 4px 20px rgba(0,0,0,0.1); border-radius: var(--border-radius);}
    
    /* 모바일 자동 확대 방지 (iOS Safari) */
    #login input[type="text"],
    #login input[type="password"],
    #login input[type="email"] {
        font-size: 16px !important;
    }
}

/* --- 데스크톱 화면 --- */
@media (min-width: 1024px) {
    body.login {display: flex; justify-content: flex-start; align-items: stretch; background-color: var(--background-dark);}
    #login {display: flex; flex-direction: column; justify-content: center; width: 50%; max-width: none; height: 100vh; margin: 0; padding: 0 5vw !important; background: var(--background-light);}
    #login h1, #login form, #login #nav, #login #backtoblog {max-width: var(--form-max-width); width: 100%; margin-left: auto; margin-right: auto;}
    #login-bg-video {top: 0; left: 50%; transform: none; width: 50%; height: 100vh;}
    body.login::after {content: ''; display: block; width: 50%; height: 100vh; background-color: #000; z-index: -2;}
}

input#wp-submit {
    margin-bottom: 5px;
}

/* --- 가입 버튼 스타일 --- */
.signup-button-container {
    margin-top: 12px;
    width: 100%;
}

.wcl-signup-button {
    width: 100%;
    height: var(--input-height);
    background-color: #059669;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wcl-signup-button:hover {
    background-color: #047857;
}

/* --- 모달 스타일 --- */
.wcl-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.wcl-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcl-modal-content {
    background-color: white;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    overflow-y: auto;
}

.wcl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 24px 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.wcl-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.wcl-modal-close {
    color: #6b7280;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.wcl-modal-close:hover {
    color: #111827;
}

.wcl-signup-form {
    padding: 0 24px 24px 24px;
    border: 0px !important;
}

.wcl-signup-form .form-group {
    margin-bottom: 20px;
}

.wcl-signup-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.wcl-signup-form .form-row .form-group {
    margin-bottom: 0;
}

.wcl-signup-form .form-group {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .wcl-signup-form .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .wcl-modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

.wcl-signup-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.wcl-signup-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px !important;  /* 모바일 자동 확대 방지 (최소 16px 필수) */
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* 모바일 환경에서 자동 확대 완전 방지 */
@media (max-width: 768px) {
    .wcl-signup-form input,
    .wcl-signup-form input[type="text"],
    .wcl-signup-form input[type="email"],
    .wcl-signup-form input[type="password"],
    .wcl-signup-form input[type="tel"] {
        font-size: 16px !important;
    }
}

/* 비밀번호 필드 래퍼 */
.password-wrapper {
    position: relative;
    width: 100%;
}

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

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

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

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
}

.wcl-signup-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 검증 스타일 */
.wcl-signup-form input.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.wcl-signup-form input.success {
    border-color: #10b981 !important;
}

.wcl-signup-form .error-message {
    display: none;
    margin-top: 4px;
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

.wcl-signup-form .error-message.show {
    display: block;
}

.wcl-signup-form .form-error-banner {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
}

.wcl-signup-form .form-error-banner.show {
    display: block;
}

.wcl-submit-button {
    width: 100%;
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.wcl-submit-button:hover {
    background: #1d4ed8;
}

.wcl-submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.wcl-submit-button.loading {
    position: relative;
    color: transparent;
}

.wcl-submit-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wcl-spinner 0.6s linear infinite;
}

@keyframes wcl-spinner {
    to { transform: rotate(360deg); }
}

.wcl-modal-body {
    padding: 0 24px 24px 24px;
    text-align: center;
}

.wcl-modal-body p {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.wcl-modal-footer {
    padding: 0 24px 24px 24px;
    text-align: center;
}

form#lostpasswordform {
    border: 1px solid #c4c6c8 !important;
    border-radius: 13px !important;
    box-shadow: none !important;
}

/* --- 모바일 반응형 --- */
@media (max-width: 768px) {
    .wcl-modal-content {
        margin: 0;
        width: 95%;
    }
    
    .wcl-modal-header,
    .wcl-signup-form,
    .wcl-modal-body,
    .wcl-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}