/* ====================================
   TGX 认证页面公共样式
   Login / Register / ForgetEmail / ForgetPhone
   ==================================== */

:root {
    --auth-grad-btn: linear-gradient(135deg, #E8489A 0%, #7C3AED 50%, #3B82F6 100%);
    --auth-purple: #7C3AED;
    --auth-text: #1A0A2E;
    --auth-text2: #5B4D7A;
    --auth-text3: #9B8BB4;
    --auth-border: #DDD5F0;
    --auth-bg-field: #F4F2F8;
}

/* ====== Reset ====== */
.auth-page * { margin: 0; padding: 0; box-sizing: border-box; }

.auth-page {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #ece8ff 0%, #e0dbff 30%, #f0edff 60%, #f8f6ff 100%);
    position: relative;
    overflow: hidden;
    padding: 32px 16px;
}

/* ====== 光晕动画 ====== */
.auth-page::before {
    content: '';
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    top: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(124,106,255,0.28) 0%, rgba(168,85,247,0.12) 35%, transparent 60%);
    animation: auth-glow-1 8s ease-in-out infinite;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: fixed;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    bottom: -180px;
    left: -120px;
    background: radial-gradient(circle, rgba(71,209,137,0.22) 0%, rgba(124,106,255,0.10) 35%, transparent 60%);
    animation: auth-glow-2 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auth-glow-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-200px, 120px) scale(1.15); }
    50% { transform: translate(-120px, 200px) scale(0.9); }
    75% { transform: translate(80px, 80px) scale(1.1); }
}

@keyframes auth-glow-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(180px, -100px) scale(1.1); }
    50% { transform: translate(100px, -180px) scale(0.95); }
    75% { transform: translate(-60px, -60px) scale(1.15); }
}

/* ====== 浮动装饰 ====== */
.auth-decor { position: fixed; pointer-events: none; }
.auth-decor-1 { width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(124,106,255,0.18); top: 8%; left: 5%; animation: auth-ring 10s linear infinite; }
.auth-decor-2 { width: 160px; height: 160px; border-radius: 50%; border: 2px solid rgba(168,85,247,0.14); bottom: 10%; right: 8%; animation: auth-ring 14s linear infinite reverse; }
.auth-decor-3 { width: 80px; height: 80px; border-radius: 16px; background: rgba(124,106,255,0.08); top: 12%; right: 15%; animation: auth-shape-1 8s ease-in-out infinite; }
.auth-decor-4 { width: 60px; height: 60px; border-radius: 12px; background: rgba(71,209,137,0.08); bottom: 18%; left: 12%; animation: auth-shape-2 10s ease-in-out infinite; }
.auth-decor-5 { width: 500px; height: 500px; border-radius: 50%; top: 20%; right: -200px; background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, transparent 55%); animation: auth-glow-3 12s ease-in-out infinite; }
.auth-decor-6 { width: 14px; height: 14px; border-radius: 50%; background: rgba(124,106,255,0.35); top: 20%; left: 30%; animation: auth-dot-1 4s ease-in-out infinite; }
.auth-decor-7 { width: 10px; height: 10px; border-radius: 50%; background: rgba(71,209,137,0.35); top: 65%; right: 18%; animation: auth-dot-1 5s ease-in-out infinite 1s; }
.auth-decor-8 { width: 8px; height: 8px; border-radius: 50%; background: rgba(124,106,255,0.30); bottom: 30%; left: 22%; animation: auth-dot-2 3.5s ease-in-out infinite 0.5s; }
.auth-decor-9 { width: 18px; height: 18px; border-radius: 4px; background: rgba(168,85,247,0.15); top: 35%; right: 25%; animation: auth-shape-3 6s ease-in-out infinite; }
.auth-decor-10 { width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(71,209,137,0.12); top: 55%; left: 6%; animation: auth-ring 18s linear infinite; }
.auth-decor-11 { width: 12px; height: 12px; border-radius: 3px; background: rgba(71,209,137,0.20); top: 15%; left: 28%; animation: auth-shape-3 5s ease-in-out infinite 2s; }
.auth-decor-12 { width: 10px; height: 10px; border-radius: 50%; background: rgba(124,106,255,0.25); bottom: 15%; right: 28%; animation: auth-dot-2 4s ease-in-out infinite 1.5s; }

@keyframes auth-ring { 0% { transform: rotate(0deg) translate(50px, 0) scale(1); } 50% { transform: rotate(180deg) translate(50px, 0) scale(1.2); } 100% { transform: rotate(360deg) translate(50px, 0) scale(1); } }
@keyframes auth-shape-1 { 0%, 100% { transform: rotate(0deg) translate(0, 0); } 25% { transform: rotate(45deg) translate(-30px, 20px); } 50% { transform: rotate(90deg) translate(15px, 40px); } 75% { transform: rotate(135deg) translate(25px, 10px); } }
@keyframes auth-shape-2 { 0%, 100% { transform: rotate(0deg) translate(0, 0); } 25% { transform: rotate(-30deg) translate(25px, -15px); } 50% { transform: rotate(-60deg) translate(-10px, -30px); } 75% { transform: rotate(-90deg) translate(-20px, 10px); } }
@keyframes auth-shape-3 { 0%, 100% { transform: rotate(0deg) translateY(0); opacity: 0.15; } 50% { transform: rotate(180deg) translateY(-20px); opacity: 0.4; } }
@keyframes auth-glow-3 { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-150px, 80px) scale(1.1); } 66% { transform: translate(-80px, -60px) scale(0.9); } }
@keyframes auth-dot-1 { 0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; } 50% { transform: translateY(-30px) scale(1.6); opacity: 0.5; } }
@keyframes auth-dot-2 { 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; } 50% { transform: translate(15px, -20px) scale(1.5); opacity: 0.45; } }

/* ====== 左右分栏卡片（登录/注册用） ====== */
.auth-split {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 400px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1.5px solid var(--auth-border);
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(124, 58, 237, 0.12);
    position: relative;
    z-index: 10;
    animation: auth-fadeIn 0.4s ease;
}

/* ====== 单卡片（找回密码用） ====== */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1.5px solid var(--auth-border);
    box-shadow: 0 16px 48px rgba(124, 58, 237, 0.12);
    padding: 40px 36px;
    position: relative;
    z-index: 10;
    animation: auth-fadeIn 0.4s ease;
}

/* ====== 左栏（品牌展示） ====== */
.auth-left {
    background: linear-gradient(145deg, #EDE9F6 0%, #F8F4FF 60%, #FCE7F3 100%);
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 70%);
    top: -80px;
    right: -80px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 72, 154, 0.10), transparent 70%);
    bottom: -60px;
    left: -40px;
}

.auth-logo {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 800;
    background: var(--auth-grad-btn);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
}

.auth-logo-sm {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 800;
    background: var(--auth-grad-btn);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.auth-sub {
    font-size: 13px;
    color: var(--auth-text3);
    margin-top: 4px;
    position: relative;
    z-index: 1;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.auth-left-body { position: relative; z-index: 1; }

.auth-headline {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.3;
    color: var(--auth-text);
    margin-bottom: 20px;
}

.auth-headline em {
    font-style: normal;
    background: var(--auth-grad-btn);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-perk {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-perk-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--auth-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
}

.auth-perk-text {
    font-size: 13px;
    color: var(--auth-text2);
    font-weight: 500;
}

.auth-perk-text strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-stats {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.auth-stat {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    padding: 10px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.07);
}

.auth-stat-val {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 800;
    background: var(--auth-grad-btn);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-stat-lbl {
    font-size: 10px;
    color: var(--auth-text3);
    margin-top: 1px;
    font-weight: 600;
}

/* ====== 右栏 / 表单区域 ====== */
.auth-right { padding: 40px 36px; }

.auth-back {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--auth-text3);
    text-decoration: none;
    margin-bottom: 28px;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-back:hover { color: var(--auth-purple); }

.auth-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--auth-text);
}

.auth-title-sm {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--auth-text);
}

.auth-hint {
    font-size: 13px;
    color: var(--auth-text3);
    margin-bottom: 24px;
}

.auth-hint a {
    color: var(--auth-purple);
    text-decoration: none;
    font-weight: 600;
}

/* ====== 表单控件 ====== */
.auth-field { margin-bottom: 14px; }

.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-text2);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.auth-field-inner { position: relative; }

.auth-field-ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--auth-text3);
    pointer-events: none;
}

.auth-field input {
    width: 100%;
    background: var(--auth-bg-field);
    border: 1.5px solid var(--auth-border);
    border-radius: 9px;
    padding: 11px 12px 11px 38px;
    font-size: 14px;
    font-family: inherit;
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
    border-color: var(--auth-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.09);
    background: white;
}

.auth-field input::placeholder {
    color: var(--auth-text3);
    opacity: 0.7;
}

/* 密码可见性切换 */
.auth-toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--auth-text3);
    cursor: pointer;
    transition: color 0.15s;
    z-index: 2;
}

.auth-toggle-pwd:hover { color: var(--auth-purple); }

/* 验证码行 */
.auth-captcha-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.auth-captcha-row .auth-field { flex: 1; margin-bottom: 0; }

.auth-captcha-img {
    height: 44px;
    border-radius: 9px;
    cursor: pointer;
    border: 1.5px solid var(--auth-border);
    transition: opacity 0.15s;
}

.auth-captcha-img:hover { opacity: 0.7; }

/* 验证码获取行 */
.auth-code-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.auth-code-row .auth-field { flex: 1; margin-bottom: 0; }

.auth-code-btn {
    background: rgba(124, 58, 237, 0.07);
    border: 1.5px solid rgba(124, 58, 237, 0.25);
    color: var(--auth-purple);
    padding: 0 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    height: 44px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.auth-code-btn:hover { background: rgba(124, 58, 237, 0.14); }
.auth-code-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 记住我 + 忘记密码 */
.auth-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    margin-top: 4px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--auth-text3);
    cursor: pointer;
}

.auth-remember input { accent-color: var(--auth-purple); }

.auth-forgot {
    font-size: 12px;
    color: var(--auth-purple);
    text-decoration: none;
    font-weight: 600;
}

.auth-forgot:hover { text-decoration: underline; }

/* 服务条款勾选 */
.auth-terms {
    margin: 4px 0 14px;
}

.auth-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--auth-text3);
    cursor: pointer;
    /* 条款文案在部分语言下会换行，用 flex-start 让勾选框对齐首行而非居中 */
}

.auth-terms-check {
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    flex: 0 0 auto;
    accent-color: var(--auth-purple);
    cursor: pointer;
}

.auth-terms-label a {
    color: var(--auth-purple);
    text-decoration: none;
    font-weight: 600;
}

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

/* 提交按钮 */
.auth-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #E8489A 0%, #7C3AED 25%, #3B82F6 50%, #7C3AED 75%, #E8489A 100%);
    background-size: 300% 100%;
    animation: auth-btn-flow 3s ease infinite;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
    transition: transform 0.15s, box-shadow 0.3s;
    margin-top: 4px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}

.auth-submit:active { transform: scale(0.98); }

@keyframes auth-btn-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hook 区域 */
.auth-hook { text-align: center; margin-top: 10px; }

.auth-hook-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--auth-text3);
    margin-bottom: 14px;
}

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

/* 底部提示 */
.auth-tip {
    text-align: center;
    font-size: 12px;
    color: var(--auth-text3);
    padding: 10px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 8px;
}

.auth-tip a {
    color: var(--auth-purple);
    text-decoration: none;
    font-weight: 700;
}

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

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .auth-page { padding: 16px 12px; }
    .auth-split {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .auth-left { display: none; }

    .auth-right { padding: 28px 20px; }
    .auth-back { margin-bottom: 16px; }
    .auth-card { padding: 28px 20px; }

    /* 16px 是硬门槛，不是审美选择：iOS Safari 对 font-size < 16px 的输入框，
       聚焦时会强行放大整个视口，用户还得自己捏回来。登录/注册是人人必过的
       流程，这里尤其不能放大。桌面端仍是 14px(见上面的基础规则)。 */
    .auth-field input { font-size: 16px; }
}

/* layui 弹窗样式覆盖 */
.layui-layer {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
    box-shadow: rgba(124, 106, 255, 0.18) 0px 7px 29px 0px !important;
    background: linear-gradient(to bottom, #ede9fe 0%, #ffffff 100%) !important;
}
.layui-layer-page {
    background: linear-gradient(to bottom, #f0edff 0%, #ffffff 100%) !important;
}
.layui-layer-hui {
    background-color: rgba(124, 106, 255, 0.88) !important;
}

/* ====== Auth Language Selector ====== */
.auth-lang-selector {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
}
.auth-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--auth-text2);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-lang-btn:hover {
    background: #fff;
    border-color: var(--auth-purple);
    color: var(--auth-purple);
}
.auth-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
    min-width: 140px;
    overflow: hidden;
    z-index: 30;
}
.auth-lang-dropdown.show {
    display: block;
}
.auth-lang-option {
    display: block;
    padding: 10px 16px;
    color: var(--auth-text2);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}
.auth-lang-option:hover {
    background: #f4f2f8;
    color: var(--auth-purple);
}
.auth-lang-option.active {
    background: var(--auth-purple);
    color: #fff;
    font-weight: 500;
}

/* Responsive: on auth-card (ForgetEmail/Phone), position relative to card */
.auth-card {
    position: relative;
}
.auth-card .auth-lang-selector {
    top: 16px;
    right: 16px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .auth-lang-selector {
        top: 12px;
        right: 12px;
    }
    .auth-lang-btn span {
        display: none;
    }
    .auth-lang-btn .fa-chevron-down {
        display: none;
    }
    .auth-lang-btn {
        padding: 7px 10px;
    }
}
