/**
 * RecMaker 健身訓練管理系統 - 登入頁面專用樣式
 */

/* ============================================
   背景優化
   ============================================ */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

/* 可選：使用健身主題背景 */
.login-page.fitness-theme {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* 背景動畫效果（選配）*/
.login-page::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;
    pointer-events: none;
}

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

/* ============================================
   Logo 區域優化
   ============================================ */
.login-logo {
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.login-logo img {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.login-logo img:hover {
    transform: scale(1.05);
}

/* 系統 Slogan */
.login-slogan {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease 0.3s both;
}

/* ============================================
   登入卡片優化
   ============================================ */
.login-box {
    width: 400px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

@media (max-width: 576px) {
    .login-box {
        width: 90%;
        margin: 20px auto;
    }
}

.card.card-outline {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.login-card-body {
    padding: 40px 30px;
}

.login-box-msg {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 30px;
    text-align: center;
}

/* ============================================
   輸入框優化
   ============================================ */
.input-group {
    margin-bottom: 20px;
}

.form-control {
    height: 45px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding-left: 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control::placeholder {
    color: #adb5bd;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-group:focus-within .input-group-text {
    background-color: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* ============================================
   密碼顯示/隱藏按鈕
   ============================================ */
.password-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    background-color: #e9ecef;
}

.password-toggle i {
    font-size: 1rem;
}

/* ============================================
   驗證碼區域優化
   ============================================ */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.captcha-image {
    flex-shrink: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.captcha-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.captcha-refresh {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.captcha-refresh:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: #fff;
    transform: rotate(180deg);
}

.captcha-input {
    flex: 1;
}

/* ============================================
   記住我勾選框
   ============================================ */
.icheck-primary {
    display: flex;
    align-items: center;
}

.icheck-primary input[type="checkbox"] {
    margin-right: 8px;
}

.icheck-primary label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

/* ============================================
   登入按鈕優化
   ============================================ */
.btn-login {
    height: 45px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

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

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 登入中狀態 */
.btn-login.loading {
    pointer-events: none;
}

.btn-login.loading i {
    animation: spin 1s linear infinite;
}

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

/* ============================================
   錯誤訊息優化
   ============================================ */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    animation: shake 0.5s ease;
}

.error-message i {
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ============================================
   載入動畫
   ============================================ */
.login-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-loading.active {
    display: flex;
}

.login-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   頁面動畫
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ============================================
   響應式設計
   ============================================ */
@media (max-width: 576px) {
    .login-card-body {
        padding: 30px 20px;
    }
    
    .login-box-msg {
        font-size: 1rem;
    }
    
    .captcha-container {
        flex-wrap: wrap;
    }
    
    .captcha-image {
        width: 100%;
    }
}

/* ============================================
   列印隱藏
   ============================================ */
@media print {
    .login-page {
        display: none;
    }
}

