/* ============================================================
   Sub2API 登录页美化 — 壁纸 + 玻璃拟态
   仅作用于认证页(登录/注册/找回密码), 不影响后台其他页面
   ============================================================ */

/* ---------- 1. 认证页根容器: 挂壁纸 ---------- */
/* 精确匹配 AuthLayout 根节点结构, 避免误伤其他页面 */
[class*="min-h-screen"][class*="overflow-hidden"]:has(> .relative.z-10.w-full.max-w-md > .card-glass) {
    background-image: url("/custom/login-wallpaper-v3.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* iOS Safari 对 fixed 支持不佳, scroll 在全屏容器下视觉一致 */
    background-color: #e0f2fe;
}

/* ---------- 1.5 关键修复: 中和官方不透明渐变遮罩层, 让壁纸透出来 ---------- */
[class*="min-h-screen"][class*="overflow-hidden"]:has(> .relative.z-10.w-full.max-w-md > .card-glass) > .bg-gradient-to-br {
    background-image: none !important;
    background-color: transparent !important;
}

/* ---------- 2. 宽屏时登录卡片右移(壁纸主体在左侧) ---------- */
@media (min-width: 1024px) {
    [class*="min-h-screen"][class*="overflow-hidden"]:has(> .relative.z-10.w-full.max-w-md > .card-glass) {
        justify-content: flex-end;
        padding-right: 8vw;
    }
}

/* ---------- 3. 登录卡片: 更透明的毛玻璃 + 高光边框 + 入场动画 ---------- */
.relative.z-10.w-full.max-w-md > .card-glass {
    background-color: rgba(255, 255, 255, 0.52) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.15);
    backdrop-filter: blur(20px) saturate(1.15);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: sub2api-card-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.relative.z-10.w-full.max-w-md > .card-glass:is(.dark *) {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(148, 163, 184, 0.25);
}

@keyframes sub2api-card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 4. 卡片内输入框: 半透明玻璃质感 ---------- */
.relative.z-10.w-full.max-w-md input {
    background-color: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.85);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.relative.z-10.w-full.max-w-md input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
    background-color: rgba(255, 255, 255, 0.85) !important;
}

.relative.z-10.w-full.max-w-md input:is(.dark *) {
    background-color: rgba(30, 41, 59, 0.55) !important;
    border-color: rgba(148, 163, 184, 0.3);
}

.relative.z-10.w-full.max-w-md input:is(.dark *):focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

/* ---------- 5. 登录按钮: 阴影 + 悬浮微抬升 ---------- */
.relative.z-10.w-full.max-w-md .btn-primary {
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.relative.z-10.w-full.max-w-md .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
}

/* ---------- 6. 卡片外的文字: 标题 / 注册入口 / 版权 (直接压在壁纸上, 需保证可读) ---------- */
/* 站点标题(渐变字): 白色光晕, 亮色和暗色壁纸上都清晰 */
.relative.z-10.w-full.max-w-md > .mb-8.text-center .text-gradient {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}

/* 副标题 */
.relative.z-10.w-full.max-w-md > .mb-8.text-center > .text-sm {
    color: #334155 !important;
    text-shadow: 0 0 6px #fff, 0 0 14px #fff, 0 0 2px #fff;
}

/* 「还没有账户？注册」: 玻璃胶囊, 壁纸上一定看得见 */
.relative.z-10.w-full.max-w-md > .mt-6.text-center.text-sm {
    display: table;
    margin: 20px auto 0;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #334155 !important;
}

.relative.z-10.w-full.max-w-md > .mt-6.text-center.text-sm a {
    color: #0f766e !important;
    font-weight: 700;
    text-decoration: none;
}

.relative.z-10.w-full.max-w-md > .mt-6.text-center.text-sm a:hover {
    color: #115e59 !important;
    text-decoration: underline;
}

/* 版权行 */
.relative.z-10.w-full.max-w-md > .mt-8.text-center.text-xs {
    color: #334155 !important;
    text-shadow: 0 0 5px #fff, 0 0 12px #fff, 0 0 2px #fff;
}
