/**
 * 武侠MUD登录页面样式
 * 符合现代UI/UX标准的响应式设计
 */

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

:root {
    --primary-red: #c41e3a;
    --primary-gold: #d4af37;
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-purple: #6c5ce7;
    --accent-blue: #0984e3;
    --success-green: #00b894;
    --danger-red: #d63031;
    --warning-orange: #fdcb6e;
    --text-light: #dfe6e9;
    --text-muted: #b2bec3;
    --bg-dark: #0c0c0c;
    --bg-card: #1e1e1e;
    --bg-input: #2d2d2d;
    --border-color: #404040;
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-light);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(196, 30, 58, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(108, 92, 231, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.login-wrapper {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(10px);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold), var(--accent-purple));
}

.login-header {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--primary-dark) 100%);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '🏮';
    position: absolute;
    top: -30px;
    left: -30px;
    font-size: 150px;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.login-header::after {
    content: '⚔️';
    position: absolute;
    bottom: -30px;
    right: -30px;
    font-size: 150px;
    opacity: 0.05;
    transform: rotate(15deg);
}

.logo-section {
    position: relative;
    z-index: 2;
}

.logo-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.8em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-gold), #f5d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    letter-spacing: 6px;
}

.logo-subtitle {
    font-size: 1.05em;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.login-content {
    padding: 40px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease;
    font-size: 0.95em;
}

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

.alert-success {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.2), rgba(0, 184, 148, 0.1));
    color: var(--success-green);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.alert-error {
    background: linear-gradient(135deg, rgba(214, 48, 49, 0.2), rgba(214, 48, 49, 0.1));
    color: var(--danger-red);
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.alert-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.label-text {
    display: inline-block;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 1.2em;
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    font-size: 1em;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-light);
    transition: var(--transition-normal);
    font-family: inherit;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1), var(--shadow-glow);
    background: #353535;
}

.form-input.error {
    border-color: var(--danger-red);
    animation: shake 0.5s ease;
}

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

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 1.2em;
    opacity: 0.5;
    transition: var(--transition-fast);
    z-index: 2;
    border-radius: var(--radius-sm);
}

.password-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.eye-icon {
    display: inline-block;
}

.error-text {
    color: var(--danger-red);
    font-size: 0.875em;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

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

.error-icon {
    font-size: 1em;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
    background: var(--bg-input);
}

.remember-me:hover .checkbox-custom {
    border-color: var(--primary-gold);
}

.remember-me input:checked ~ .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    border-color: transparent;
}

.remember-me input:checked ~ .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 0.9em;
    font-weight: bold;
}

.remember-text {
    font-size: 0.95em;
    color: var(--text-muted);
}

.forgot-password {
    color: var(--primary-gold);
    text-decoration: none;
    font-size: 0.95em;
    transition: var(--transition-fast);
    font-weight: 500;
}

.forgot-password:hover {
    color: #f5d78c;
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: inherit;
    letter-spacing: 1px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    color: white;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.4);
}

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

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

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-light);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.social-btn:hover {
    border-color: var(--primary-gold);
    background: #353535;
    transform: translateY(-1px);
}

.social-icon {
    font-size: 1.3em;
}

.social-text {
    flex: 1;
    text-align: left;
}

.register-prompt {
    text-align: center;
    padding-top: 8px;
}

.prompt-text {
    color: var(--text-muted);
    font-size: 0.95em;
}

.register-link {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    margin-left: 6px;
}

.register-link:hover {
    color: #f5d78c;
    text-decoration: underline;
}

.features-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-card {
    background: rgba(30, 30, 30, 0.8);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-gold);
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.7;
}

.login-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 20px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9em;
}

@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 500px;
    }

    .features-section {
        order: -1;
    }

    .feature-card {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 16px;
    }

    .login-header {
        padding: 32px 24px;
    }

    .logo-text {
        font-size: 2.2em;
        letter-spacing: 4px;
    }

    .login-content {
        padding: 28px 24px;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .features-section {
        display: none;
    }
}

@media (max-width: 400px) {
    .login-header {
        padding: 28px 20px;
    }

    .login-content {
        padding: 24px 20px;
    }

    .btn {
        padding: 14px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
