/* ===== 기본 설정 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #D73838;
    --primary-dark: #B52E2E;
    --primary-light: #FF4C4C;
    --secondary-color: #D4AF37;
    --text-dark: #1a1a1a;
    --text-medium: #666666;
    --text-light: #999999;
    --border-color: #E8E8E8;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 배경 패턴 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0px);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-20px);
    }
}
/* ===== 메인 컨테이너 ===== */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-container {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

/* ===== 로고 섹션 ===== */
.logo-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 45px 35px 35px;
    text-align: center;
    position: relative;
}

.logo-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(215, 56, 56, 0.2), transparent);
}

.logo-wrapper {
    margin-bottom: 18px;
}

.logo-wrapper img {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(215, 56, 56, 0.1));
    transition: transform var(--transition-normal);
}

.logo-wrapper:hover img {
    transform: scale(1.02);
}

.welcome-text {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-top: 8px;
}

/* ===== 폼 섹션 ===== */
.form-section {
    padding: 40px 35px 30px;
}

.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 22px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    transition: color var(--transition-fast);
    pointer-events: none;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 15px 16px 15px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background-color: var(--bg-light);
    transition: all var(--transition-normal);
    font-family: inherit;
    color: var(--text-dark);
}

.input-group input::placeholder {
    color: var(--text-light);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(215, 56, 56, 0.08);
}

.input-group input:focus ~ .input-icon {
    color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-light);
    transition: color var(--transition-fast);
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.eye-icon {
    display: block;
}

.input-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-medium);
    padding-left: 4px;
}

.input-message.error {
    color: var(--primary-color);
}

.input-message.success {
    color: #10b981;
}

/* ===== 버튼 스타일 ===== */
.login-button,
.signup-button,
.modal-submit-button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(215, 56, 56, 0.3);
    margin-top: 10px;
    margin-bottom: 20px;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(215, 56, 56, 0.4);
}

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

.button-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.login-button.loading .button-text,
.modal-submit-button.loading .button-text,
.modal-submit-button.loading .button-icon {
    display: none;
}

.login-button.loading .button-loader,
.modal-submit-button.loading .button-loader {
    display: block;
}

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

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 18px;
}

/* ===== 회원가입 버튼 ===== */
.signup-button {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-bottom: 18px;
}

.signup-button:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(215, 56, 56, 0.3);
    transform: translateY(-2px);
}

/* ===== 링크 버튼 ===== */
.links {
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.link-button {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
}

.link-button:hover {
    color: var(--primary-color);
    background-color: rgba(215, 56, 56, 0.05);
}

/* ===== 저작권 정보 ===== */
.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

/* ===== 모달 스타일 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(215, 56, 56, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-header {
    padding: 45px 35px 28px;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-color);
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(215, 56, 56, 0.3);
}

.modal-icon svg {
    color: white;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.modal-header p {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.6;
}

.modal-body {
    padding: 35px;
}

.modal-submit-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(215, 56, 56, 0.3);
    margin-top: 10px;
}

.modal-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(215, 56, 56, 0.4);
}

.button-icon {
    transition: transform var(--transition-normal);
}

.modal-submit-button:hover .button-icon {
    transform: translateX(4px);
}

/* ===== 성공 메시지 ===== */
.success-message {
    display: none;
    text-align: center;
    padding: 35px 20px;
}

.success-message.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.success-icon svg {
    color: white;
}

.success-message h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.success-message p {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 28px;
}

.close-modal-button {
    padding: 13px 36px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.close-modal-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(215, 56, 56, 0.3);
}

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

    .login-wrapper {
        max-width: 100%;
    }

    .logo-section {
        padding: 35px 28px 28px;
    }

    .form-section {
        padding: 32px 28px 25px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header {
        padding: 38px 28px 24px;
    }

    .modal-body {
        padding: 28px 25px;
    }
}

@media (max-width: 400px) {
    .logo-section {
        padding: 30px 22px 22px;
    }

    .form-section {
        padding: 28px 22px 20px;
    }

    .login-button,
    .signup-button,
    .modal-submit-button {
        padding: 14px;
        font-size: 14px;
    }

    .modal-header {
        padding: 32px 22px 20px;
    }

    .modal-header h2 {
        font-size: 19px;
    }

    .modal-body {
        padding: 24px 20px;
    }
}