/* 
 * CH_SCH 주일학교 관리 시스템 - 로그인 페이지 스타일
 */

body.login-page {
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    position: relative;
}

.login-header::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 25px solid var(--primary-dark);
}

.church-logo {
    font-size: 3.5rem;
    margin-bottom: 0.8rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.system-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.system-subtitle {
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-weight: 300;
}

.login-body {
    padding: 3rem 2.5rem 2.5rem;
}

.welcome-message {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    font-size: 1rem;
}

.form-floating {
    position: relative;
    margin-bottom: 1.8rem;
}

.form-floating .form-control {
    height: 58px;
    padding: 1rem 0.75rem 0.25rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-floating .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(221, 72, 20, 0.15);
    background-color: white;
}

.form-floating .form-control:not(:placeholder-shown) {
    background-color: white;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--secondary-color);
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    z-index: 5;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--dark-color);
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-button {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(221, 72, 20, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-button .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.login-button.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .remember-forgot {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .form-check-label {
        font-size: 0.85rem;
    }

    .forgot-password {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body.login-page {
        padding: 10px;
    }

    .login-container {
        max-width: 100%;
        border-radius: 15px;
    }

    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .church-logo {
        font-size: 3rem;
    }

    .system-title {
        font-size: 1.3rem;
    }

    .login-body {
        padding: 2.5rem 1.5rem 2rem;
    }

    .form-floating .form-control {
        height: 54px;
        font-size: 0.95rem;
    }

    .form-check-label {
        font-size: 0.8rem;
    }

    .forgot-password {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .login-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .church-logo {
        font-size: 2.5rem;
    }
    
    .system-title {
        font-size: 1.2rem;
    }
    
    .login-body {
        padding: 2rem 1rem 1.5rem;
    }
}
