/* ========================================
   전역 스타일 리셋
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   메인 레이아웃
   ======================================== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 왼쪽 배경 영역 */
.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.left-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.left-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 500px;
}

.brand-logo {
    text-align: center;
    margin-bottom: 50px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-circle i {
    font-size: 36px;
    color: white;
}

.brand-name {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
}

.welcome-message {
    text-align: center;
    margin-bottom: 60px;
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
}

.welcome-desc {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 22px;
    color: white;
}

.feature-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-text p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* 오른쪽 로그인 폼 영역 */
.login-right {
    flex: 0 0 500px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 40px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* ========================================
   폼 컨트롤
   ======================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.label-icon {
    font-size: 14px;
    color: #667eea;
}

.input-container {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: #1a1a1a;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* 셀렉트 박스 */
select.form-control {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

.select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    font-size: 14px;
}

/* 비밀번호 토글 */
.password-container {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #667eea;
}

/* 폼 옵션 */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}

.forgot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #764ba2;
}

/* 로그인 버튼 */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

/* 폼 푸터 */
.form-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.footer-info i {
    color: #667eea;
}

.footer-info strong {
    color: #374151;
}

/* 저작권 */
.copyright-text {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
}

.copyright-text p {
    font-size: 12px;
    color: #9ca3af;
}

/* ========================================
   Toast 알림
   ======================================== */
.toast-notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #667eea;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    color: white;
}

.toast.success .toast-icon {
    background: #10b981;
}

.toast.error .toast-icon {
    background: #ef4444;
}

.toast.warning .toast-icon {
    background: #f59e0b;
}

.toast.info .toast-icon {
    background: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-line;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #374151;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-out forwards;
}

/* ========================================
   2단계 인증 모달
   ======================================== */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.auth-icon-wrapper {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.auth-icon-wrapper i {
    font-size: 32px;
    color: white;
}

.auth-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.auth-modal-desc {
    font-size: 14px;
    color: #6b7280;
}

.auth-modal-body {
    padding: 32px;
}

.auth-info-text {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 28px;
}

.auth-info-text strong {
    color: #374151;
    font-weight: 600;
}

.code-input-wrapper {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 28px;
}

.code-input {
    width: 50px;
    height: 60px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    background: #f9fafb;
    transition: all 0.3s ease;
    outline: none;
}

.code-input:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.code-input:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.timer-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 10px;
}

.timer-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.timer-text i {
    color: #667eea;
}

.timer-value {
    font-weight: 600;
    color: #ef4444;
}

.resend-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.resend-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
}

.resend-btn:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.auth-modal-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    flex: 1;
    padding: 14px;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* ========================================
   비밀번호 찾기 모달
   ======================================== */
.forgot-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.forgot-modal-overlay.active {
    display: flex;
}

.forgot-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: #f9fafb;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.forgot-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
}

.forgot-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.forgot-icon i {
    font-size: 32px;
    color: white;
}

.forgot-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.forgot-modal-body {
    padding: 0 32px 32px;
}

.forgot-info-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #f0f9ff;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
}

.forgot-info-box i {
    flex-shrink: 0;
    color: #3b82f6;
    font-size: 18px;
    margin-top: 2px;
}

.forgot-info-box p {
    flex: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.forgot-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.forgot-warning i {
    color: #f59e0b;
    font-size: 16px;
}

.forgot-warning span {
    font-size: 13px;
    color: #78350f;
    font-weight: 500;
}

.forgot-modal-footer {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
}

/* ========================================
   레이어 팝업
   ======================================== */
.layer-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.layer-popup-window {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
}

.layer-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 24px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-popup-content {
    flex: 1;
    padding: 24px;
}

.layer-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.layer-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   반응형 디자인
   ======================================== */
@media (max-width: 1024px) {
    .login-left {
        flex: 0 0 400px;
        padding: 40px;
    }

    .left-content {
        max-width: 100%;
    }

    .brand-name {
        font-size: 28px;
    }

    .welcome-message h2 {
        font-size: 24px;
    }

    .login-right {
        flex: 1;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        flex: none;
        min-height: 400px;
        padding: 40px 24px;
    }

    .feature-list {
        display: none;
    }

    .login-right {
        flex: none;
        padding: 40px 24px;
    }

    .code-input-wrapper {
        gap: 8px;
    }

    .code-input {
        width: 44px;
        height: 54px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .login-left {
        min-height: 300px;
        padding: 30px 20px;
    }

    .brand-name {
        font-size: 24px;
    }

    .welcome-message h2 {
        font-size: 20px;
    }

    .welcome-desc {
        font-size: 14px;
    }

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

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

    .toast-notification-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .auth-modal,
    .terms-modal,
    .forgot-modal {
        max-width: 100%;
    }

    .code-input-wrapper {
        gap: 6px;
    }

    .code-input {
        width: 40px;
        height: 50px;
        font-size: 18px;
    }
}

/* ========================================
   애니메이션
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-right {
    animation: fadeInUp 0.6s ease-out;
}

.left-content > * {
    animation: fadeInUp 0.8s ease-out;
}

.brand-logo {
    animation-delay: 0.1s;
}

.welcome-message {
    animation-delay: 0.2s;
}

.feature-list {
    animation-delay: 0.3s;
}
