/* ===================================
   로그인 페이지 - 좌우 분할 레이아웃
   =================================== */

/* 전체 페이지 */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
}

/* 로그인 래퍼 - 좌우 분할 */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ===================================
   좌측 브랜드 영역
   =================================== */
.login-left {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #A50082 0%, #7057A3 50%, #32324D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 로그인 이미지 */
.login-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    z-index: 2;
}

/* ===================================
   우측 로그인 폼 영역
   =================================== */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 40px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

/* 로그인 헤더 */
.login-header {
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.login-desc {
    font-size: 15px;
    color: #666666;
    margin: 0;
}

/* ===================================
   로그인 폼
   =================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fafafa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #7057A3;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(112, 87, 163, 0.15);
}

.form-input::placeholder {
    color: #999999;
}

/* 비밀번호 입력 래퍼 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

/* 비밀번호 토글 버튼 */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999999;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle:hover {
    color: #7057A3;
}

.password-toggle i {
    font-size: 16px;
}

/* 로그인 버튼 */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #A50082 0%, #7057A3 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #850069 0%, #5a4682 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(165, 0, 130, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 로딩 상태 */
.login-btn.loading {
    position: relative;
    color: transparent;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   하단 링크
   =================================== */
.login-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eeeeee;
}

.footer-link {
    font-size: 14px;
    color: #666666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #7057A3;
}

.signup-link {
    font-weight: 600;
    color: #A50082;
}

.signup-link:hover {
    color: #850069;
}

/* ===================================
   메시지 스타일
   =================================== */
.error-message,
.success-message {
    display: none;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.error-message::before {
    content: '⚠️ ';
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.success-message::before {
    content: '✓ ';
}

/* 입력 필드 에러 상태 */
.form-input.error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* ===================================
   반응형 디자인
   =================================== */
@media (max-width: 1024px) {
    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: 24px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-title {
        font-size: 28px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* iOS 확대 방지 */
    }

    .login-btn {
        padding: 14px;
    }

    .login-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
