@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
    --primary-gold: #d4af37;
    --dark-gold: #b8941f;
    --light-gold: #f4e4bc;
    --deep-black: #1a1a1a;
    --charcoal: #2c2c2c;
    --dark-grey: #3a3a3a;
    --cream: #f5f5dc;
    --rose-gold: #e8b4a0;
    --wechat-green: #1aad19;
    --wechat-hover: #179b16;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Noto Serif SC', 'Playfair Display', serif;
    overflow-x: hidden;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--deep-black) 0%, var(--charcoal) 50%, var(--dark-grey) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* 動態背景效果 */
    .login-page::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%), radial-gradient(circle at 40% 60%, rgba(232, 180, 160, 0.08) 0%, transparent 50%);
        animation: backgroundFloat 6s ease-in-out infinite alternate;
    }

@keyframes backgroundFloat {
    0% {
        opacity: 0.8;
        transform: translateY(0px);
    }

    100% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* 登入容器 */
.login-container {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(25px);
    border: 3px solid var(--primary-gold);
    border-radius: 30px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(212, 175, 55, 0.2);
    position: relative;
    z-index: 10;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    margin: 20px;
}

    .login-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, var(--primary-gold), var(--rose-gold), var(--primary-gold));
        animation: goldFlow 3s linear infinite;
    }

@keyframes goldFlow {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* 標題區域 */
.login-header {
    text-align: center;
    padding: 40px 30px 30px;
    position: relative;
}

.crown-icon {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    animation: crownGlow 2s ease-in-out infinite alternate;
}

@keyframes crownGlow {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    }

    100% {
        transform: scale(1.05) rotate(2deg);
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    }
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-gold), var(--light-gold), var(--primary-gold));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 3s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes goldShimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.subtitle {
    color: var(--cream);
    font-size: 1.1rem;
    opacity: 0.8;
    font-style: italic;
}

/* 微信登入按鈕 */
.wechat-login-btn {
    background: linear-gradient(135deg, var(--wechat-green), #0d8912);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 20px 40px;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(26, 173, 25, 0.4);
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .wechat-login-btn:hover {
        background: linear-gradient(135deg, var(--wechat-hover), #0a7a0f);
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(26, 173, 25, 0.6);
    }

.wechat-icon {
    font-size: 1.5rem;
    animation: wechatPulse 2s ease-in-out infinite;
}

@keyframes wechatPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* 分隔線 */
.login-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--cream);
    opacity: 0.6;
}

    .login-divider::before,
    .login-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    }

    .login-divider span {
        padding: 0 15px;
        font-size: 0.9rem;
    }

/* 測試登入區域 */
.test-login-area {
    padding: 0 40px 40px;
}

.test-login-toggle {
    background: rgba(58, 58, 58, 0.6);
    border: 2px solid var(--dark-grey);
    border-radius: 15px;
    color: var(--cream);
    font-size: 0.9rem;
    padding: 10px 20px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

    .test-login-toggle:hover {
        border-color: var(--primary-gold);
        background: rgba(58, 58, 58, 0.8);
    }

.test-login-form {
    display: none;
    animation: slideDown 0.3s ease-out;
}

    .test-login-form.show {
        display: block;
    }

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    color: var(--light-gold);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: block;
}

.form-control {
    background: rgba(58, 58, 58, 0.8);
    border: 2px solid var(--dark-grey);
    border-radius: 12px;
    color: var(--cream);
    font-size: 1rem;
    padding: 15px 20px;
    width: 100%;
    transition: all 0.4s ease;
}

    .form-control:focus {
        background: rgba(58, 58, 58, 0.95);
        border-color: var(--primary-gold);
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
        outline: none;
        color: var(--cream);
    }

.test-login-btn {
    background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
    border: none;
    border-radius: 20px;
    color: var(--deep-black);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 30px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

    .test-login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
    }

/* 錯誤訊息 */
.error-message {
    background: rgba(128, 0, 32, 0.9);
    border: 2px solid #dc3545;
    border-radius: 15px;
    color: #fff;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(128, 0, 32, 0.3);
}

/* 載入動畫 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dark-grey);
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 底部裝飾 */
.login-footer {
    text-align: center;
    padding: 20px 40px 40px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.decorative-line {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    flex: 1;
    max-width: 80px;
}

.gem-icon {
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin: 0 20px;
    animation: gemSparkle 1.5s ease-in-out infinite;
}

@keyframes gemSparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(180deg);
    }
}

.copyright {
    color: var(--cream);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-top: 15px;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        border-radius: 25px;
        max-width: 95%;
    }

    .login-header {
        padding: 30px 20px 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    .test-login-area {
        padding: 0 25px 30px;
    }

    .wechat-login-btn {
        padding: 18px 30px;
        font-size: 1.2rem;
    }

    .login-footer {
        padding: 15px 25px 30px;
    }
}

/* 管理員專屬樣式 */
.admin-badge {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
    }
}

.admin-icon {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    animation: adminIconFloat 3s ease-in-out infinite;
}

@keyframes adminIconFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.security-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 15px;
    color: #ffc107;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 0.9rem;
    animation: securityPulse 2s ease-in-out infinite;
}

@keyframes securityPulse {
    0%, 100% {
        border-color: rgba(255, 193, 7, 0.3);
        box-shadow: 0 0 0 rgba(255, 193, 7, 0);
    }

    50% {
        border-color: rgba(255, 193, 7, 0.5);
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.2);
    }
}

.admin-login-btn {
    background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
    border: none;
    border-radius: 25px;
    color: var(--deep-black);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 18px 40px;
    width: 100%;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    position: relative;
    overflow: hidden;
}

    .admin-login-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(212, 175, 55, 0.6);
    }

    .admin-login-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .admin-login-btn:hover::before {
        width: 300px;
        height: 300px;
    }

.password-toggle {
    position: absolute;
    right: 15px;
    top: 65%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-gold);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: all 0.3s ease;
}

    .password-toggle:hover {
        color: var(--light-gold);
        transform: translateY(-50%) scale(1.1);
    }

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

    .remember-me input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 8px;
        cursor: pointer;
        accent-color: var(--primary-gold);
    }

    .remember-me label {
        color: var(--cream);
        font-size: 0.9rem;
        cursor: pointer;
        user-select: none;
    }

.login-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.feature-item {
    background: rgba(58, 58, 58, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

    .feature-item:hover {
        background: rgba(58, 58, 58, 0.6);
        border-color: var(--primary-gold);
        transform: translateY(-3px);
    }

    .feature-item i {
        color: var(--primary-gold);
        font-size: 1.5rem;
        margin-bottom: 8px;
        display: block;
    }

    .feature-item span {
        color: var(--cream);
        font-size: 0.75rem;
        display: block;
    }

@media (max-width: 480px) {
    .login-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .feature-item {
        padding: 12px 15px;
    }

        .feature-item i {
            display: inline-block;
            margin-right: 8px;
            margin-bottom: 0;
        }

        .feature-item span {
            display: inline;
        }
}
