/* ===================================
   Login Page Styles - Modern & Elegant
   =================================== */

:root {
    /* Refined Color Palette */
    --primary: #2c5f7c;
    --primary-dark: #1a3d52;
    --primary-light: #4a8fb8;
    --accent: #e67e22;
    --success: #27ae60;
    --danger: #e74c3c;

    /* Neutral Colors */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #ffffff;
    --border: #dfe6e9;
    --input-bg: #f8fafc;

    /* Effects */
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 20px 50px rgba(44, 95, 124, 0.1);
    --radius: 16px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', -apple-system, sans-serif;
    background-color: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, rgba(44, 95, 124, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(44, 95, 124, 0.05) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.8s var(--transition);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Decoration */
.bg-decoration {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}

.bg-decoration::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    top: -50%;
    left: -50%;
    pointer-events: none;
}

.book-spine {
    position: absolute;
    width: 40px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    bottom: -20px;
}

.book-spine-1 {
    left: 10%;
    transform: rotate(-10deg);
}

.book-spine-2 {
    left: 25%;
    transform: rotate(5deg);
    height: 140px;
}

.book-spine-3 {
    right: 25%;
    transform: rotate(-5deg);
    height: 130px;
}

.book-spine-4 {
    right: 10%;
    transform: rotate(15deg);
}

/* Header Content */
.login-header {
    text-align: center;
    z-index: 2;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.9);
}

.login-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
    color: #fff;
}

.login-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* Card Body */
.login-card {
    padding: 40px 35px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.label-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(44, 95, 124, 0.08);
}

.form-input::placeholder {
    color: #b2bec3;
}

/* Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Button */
.btn-login {
    width: fit-content;
    min-width: 140px;
    margin: 10px auto 0;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.2);
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-text {
    white-space: nowrap;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(44, 95, 124, 0.3);
}

.btn-login:hover .btn-icon {
    transform: translateX(3px);
}

.btn-login:active {
    transform: translateY(0);
}

/* Footer & Copyright */
.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer-icon {
    width: 14px;
    height: 14px;
}

.copyright {
    margin-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Error Message */
.error-message {
    padding: 10px 15px;
    background: #fff5f5;
    border-left: 4px solid var(--danger);
    color: #c53030;
    font-size: 0.85rem;
    border-radius: 4px;
    display: none;
}

.error-message[style*="display: block"] {
    display: block !important;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
    }

    body {
        padding: 0;
    }
}