/* ========================================
   雅加达生活通 - 会员登录页样式
   ======================================== */

/* ---------- 动态背景 ---------- */
.dynamic-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-warm) 50%, var(--bg) 100%);
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 30s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 85, 46, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
    animation-delay: -10s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 85, 46, 0.1) 0%, transparent 70%);
    top: 40%;
    left: 20%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(5deg); }
    50% { transform: translate(-10px, 20px) rotate(-5deg); }
    75% { transform: translate(-30px, -10px) rotate(3deg); }
}

/* ---------- 装饰线条 ---------- */
.decorative-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

.decorative-lines::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 10%;
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphShape 15s ease-in-out infinite;
}

.decorative-lines::after {
    content: '';
    position: absolute;
    bottom: 15%;
    left: 5%;
    width: 150px;
    height: 150px;
    border: 2px solid var(--accent);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphShape 12s ease-in-out infinite reverse;
}

@keyframes morphShape {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

/* ---------- 主容器 ---------- */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    max-width: 440px;
    margin: 0 auto;
}

/* ---------- 头部 ---------- */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow-hover);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.2s;
}

.back-btn:hover svg {
    fill: var(--primary);
}

/* ---------- 品牌区域 ---------- */
.header-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 40px;
}

.brand-section {
    text-align: center;
    padding: 16px 0 26px;
    animation: fadeIn 0.6s ease-out 0.1s both;
}

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

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(255, 85, 46, 0.35);
    position: relative;
    overflow: hidden;
}

.brand-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

.brand-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 1;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.brand-welcome {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* ---------- 登录卡片 ---------- */
.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

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

/* ---------- 表单组 ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 44px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.25s ease;
}

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

.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(255, 85, 46, 0.1);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
    pointer-events: none;
}

.form-input:focus ~ .input-icon {
    fill: var(--primary);
}

/* ---------- 密码切换 ---------- */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.password-toggle:hover {
    background: rgba(0,0,0,0.04);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.password-toggle:hover svg {
    fill: var(--primary);
}

/* ---------- 忘记密码 ---------- */
.forgot-password {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary);
}

/* ---------- 登录按钮 ---------- */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 85, 46, 0.3);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.login-btn:hover::before {
    transform: translateX(100%);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 85, 46, 0.4);
}

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

.login-btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #ddd 100%);
    box-shadow: none;
    cursor: not-allowed;
}

/* ---------- 底部注册链接 ---------- */
.register-link {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.register-link-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.register-link-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.register-link-text a:hover {
    text-decoration: underline;
}

/* ---------- 安全提示 ---------- */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    animation: fadeIn 0.6s ease-out 0.35s both;
}

.security-notice svg {
    width: 14px;
    height: 14px;
    fill: var(--success);
}

/* ---------- 表单面板切换 ---------- */
.login-panel {
    display: none;
}

.login-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ---------- 记住我 ---------- */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 20px;
}

.remember-me input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-custom svg {
    width: 12px;
    height: 12px;
    fill: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.remember-me input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input:checked + .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.remember-me span:last-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
    .container {
        padding: 40px 24px;
        justify-content: center;
    }

    .login-card {
        padding: 40px 36px;
    }
}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
    .shape-1 {
        background: radial-gradient(circle, rgba(255, 85, 46, 0.2) 0%, transparent 70%);
    }

    .shape-2 {
        background: radial-gradient(circle, rgba(245, 166, 35, 0.15) 0%, transparent 70%);
    }

    .shape-3 {
        background: radial-gradient(circle, rgba(255, 85, 46, 0.12) 0%, transparent 70%);
    }

    .decorative-lines {
        opacity: 0.05;
    }

    .form-input {
        background: rgba(255,255,255,0.05);
    }

    .form-input:focus {
        background: rgba(255,255,255,0.08);
    }

    .checkbox-custom {
        background: rgba(255,255,255,0.05);
    }
}
