/* AequiLex 登入頁面樣式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2C3E50;
    --secondary: #34495E;
    --accent: #3498DB;
    --success: #2ECC71;
    --warning: #F39C12;
    --danger: #E74C3C;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --bg: #F8F9FA;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 背景動畫 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-30px) translateX(30px);
    }
}

/* 登入容器 */
.login-container {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 24px;
    padding: 48px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px var(--shadow-strong);
    animation: slideUp 0.5s ease;
}

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

/* Logo 區域 */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent), #9b59b6);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.3);
}

.logo svg {
    color: var(--white);
}

.logo-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.tagline {
    font-size: 14px;
    color: var(--text-light);
}

/* 登入選項 */
.login-options {
    text-align: center;
}

.login-options h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* 登入按鈕 */
.login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow);
}

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

.btn-icon {
    flex-shrink: 0;
}

/* Google 登入按鈕 */
.google-login {
    background: var(--white);
    color: var(--text);
    border: 2px solid #E0E0E0;
}

.google-login:hover {
    border-color: #4285F4;
    box-shadow: 0 8px 16px rgba(66, 133, 244, 0.2);
}

/* 訪客登入按鈕 */
.guest-login {
    background: linear-gradient(135deg, var(--accent), #9b59b6);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.guest-login:hover {
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.4);
}

/* 分隔線 */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E0E0E0;
}

.divider span {
    padding: 0 16px;
}

/* 功能說明 */
.features {
    margin: 32px 0;
    padding: 24px;
    background: var(--bg);
    border-radius: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item svg {
    flex-shrink: 0;
    color: var(--success);
}

/* 登入說明 */
.login-info {
    margin: 24px 0;
    padding: 16px;
    background: #FEF5E7;
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    text-align: left;
}

.login-info p {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 8px;
}

.login-info p:last-child {
    margin-bottom: 0;
}

.login-info strong {
    font-weight: 600;
}

/* 條款與隱私 */
.terms {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E0E0E0;
}

.terms p {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

.terms a {
    color: var(--accent);
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* 加載提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

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

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

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

.loading-text {
    color: var(--white);
    font-size: 16px;
    margin-top: 16px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px var(--shadow-strong);
    z-index: 10000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* 響應式設計 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .login-container {
        padding: 24px 20px;
        max-width: 100%;
    }
    
    .logo {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }
    
    .logo svg {
        width: 40px;
        height: 40px;
    }
    
    .logo-section h1 {
        font-size: 26px;
    }
    
    .tagline {
        font-size: 13px;
    }
    
    .login-options h2 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }
    
    .login-btn {
        padding: 14px 20px;
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .features {
        padding: 16px;
        margin: 20px 0;
    }
    
    .feature-item {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .login-info {
        padding: 14px;
        margin: 20px 0;
    }
    
    .login-info p {
        font-size: 12px;
    }
    
    .divider {
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .login-container {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .logo svg {
        width: 35px;
        height: 35px;
    }
    
    .logo-section h1 {
        font-size: 22px;
    }
    
    .tagline {
        font-size: 12px;
    }
    
    .login-options h2 {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .login-btn {
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }
    
    .btn-icon {
        width: 18px;
        height: 18px;
    }
    
    .features {
        padding: 14px;
        margin: 16px 0;
    }
    
    .feature-item {
        font-size: 12px;
        gap: 8px;
    }
    
    .feature-item svg {
        width: 14px;
        height: 14px;
    }
    
    .login-info {
        padding: 12px;
        margin: 16px 0;
    }
    
    .login-info p {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .terms {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .terms p {
        font-size: 11px;
    }
}

/* 觸控優化 */
@media (hover: none) and (pointer: coarse) {
    .login-btn {
        min-height: 48px; /* 確保觸控區域足夠大 */
    }
    
    .login-btn:active {
        transform: scale(0.98);
    }
}
