﻿/* ============================================================
   代理系统 - 登录/注册样式
   主色：#003366  辅色：#C8102E
   移动端优先，浅灰顶部品牌区 + 纯白表单区
   ============================================================ */

:root {
    --primary: #003366;
    --primary-light: #0a4d8c;
    --primary-dark: #001f3f;
    --accent: #C8102E;
    --accent-light: #e63946;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --text-placeholder: #94a3b8;
    --radius: 14px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
}

.auth-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #001a33;
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ---------- 背景（保持深色科技感） ---------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 20% 0%, #0a3d6e 0%, transparent 55%), radial-gradient(ellipse at 80% 100%, #12294a 0%, transparent 55%), linear-gradient(160deg, #001a33 0%, #002b52 50%, #001428 100%);
    overflow: hidden;
}

.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatGlow 12s ease-in-out infinite;
}

.auth-glow-1 {
    width: 320px;
    height: 320px;
    background: #0a5ca8;
    top: -120px;
    left: -80px;
}

.auth-glow-2 {
    width: 280px;
    height: 280px;
    background: var(--accent);
    bottom: -140px;
    right: -60px;
    opacity: 0.25;
    animation-delay: -6s;
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(80, 140, 220, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(80, 140, 220, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

@keyframes floatGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -20px) scale(1.08);
    }
}

/* ---------- 主体 ---------- */
.auth-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    /* 移动端左右边距缩小到 12px */
    padding: 24px 12px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* PC 端适当放大边距 */
@media (min-width: 768px) {
    .auth-main {
        padding: 32px 16px;
    }
}

/* ---------- 卡片（浅色风格） ---------- */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    overflow: hidden; /* 关键：让头部背景贴合圆角 */
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    animation: cardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0; /* 去掉整体 padding，由内部处理 */
}

.auth-card-wide {
    max-width: 460px;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- 顶部通栏品牌区（浅灰背景） ---------- */
.auth-header-brand {
    background: #f1f5f9; /* 浅灰蓝，和底部白底区分，衬托 LOGO */
    padding: 32px 28px 24px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0; /* 分割线 */
}

.auth-brand-logo {
    height: 72px; /* 从 52px 调到 72px */
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto 20px; /* 底部留白稍微增加 */
}

.auth-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary); /* 深蓝标题 */
    letter-spacing: 1px;
}

.auth-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-sub);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---------- 表单区域（纯白） ---------- */
.auth-body {
    padding: 28px;
    background: #ffffff;
}

/* ---------- 表单元素 ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .auth-field > label {
        font-size: 13px;
        color: #334155;
        font-weight: 500;
    }

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

    .auth-input-wrap:focus-within {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
        background: #ffffff;
    }

    .auth-input-wrap input {
        flex: 1;
        width: 100%;
        background: transparent;
        border: none;
        outline: none;
        color: var(--text-main);
        font-size: 16px;
        padding: 13px 14px;
        font-family: inherit;
        border-radius: var(--radius);
    }

        .auth-input-wrap input::placeholder {
            color: var(--text-placeholder);
        }

.auth-input-wrap-code input {
    padding-right: 110px;
}

.auth-code-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.1s, background 0.2s;
}

    .auth-code-btn:active {
        transform: translateY(-50%) scale(0.96);
    }

    .auth-code-btn:disabled {
        background: #cbd5e1;
        color: #94a3b8;
        cursor: not-allowed;
    }

.auth-eye {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    padding: 0 12px;
    cursor: pointer;
    line-height: 1;
}

.auth-field-error {
    font-size: 12px;
    color: var(--accent-light);
    min-height: 14px;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #b91c1c;
}

    .auth-error:empty {
        display: none;
    }

    .auth-error ul {
        margin: 0;
        padding-left: 18px;
    }

.auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #15803d;
    margin-bottom: 16px;
    text-align: center;
    animation: successIn 0.4s ease;
}

@keyframes successIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 行与选项 ---------- */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-sub);
    cursor: pointer;
}

    .auth-checkbox input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary);
    }

.auth-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

    .auth-link:hover {
        color: var(--primary-light);
    }

/* ---------- 按钮 ---------- */
.auth-btn {
    position: relative;
    width: 100%;
    border: none;
    border-radius: var(--radius);
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.12s, box-shadow 0.25s;
    -webkit-user-select: none;
    user-select: none;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(10, 77, 140, 0.35);
}

    .auth-btn-primary:active {
        transform: scale(0.985);
        box-shadow: 0 4px 14px rgba(10, 77, 140, 0.3);
    }

    .auth-btn-primary::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
        transform: translateX(-100%);
    }

    .auth-btn-primary:hover::after {
        transform: translateX(100%);
        transition: transform 0.7s;
    }

/* ---------- 底部 ---------- */
.auth-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* ---------- Tab 切换 ---------- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.auth-tab {
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.25s;
}

    .auth-tab.active {
        background: #ffffff;
        color: var(--primary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

[data-login-panel][hidden] {
    display: none;
}

/* ---------- 注册类型切换 ---------- */
.auth-type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auth-type-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-sub);
    transition: all 0.25s;
    text-align: center;
}

    .auth-type-item input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .auth-type-item:has(input:checked),
    .auth-type-item.active {
        border-color: var(--primary);
        background: #eef2f6;
        color: var(--primary);
        font-weight: 600;
        box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
    }

.auth-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: sectionIn 0.3s ease;
}

    .auth-section[hidden] {
        display: none;
    }

@keyframes sectionIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 审核状态页 (AuditStatus) ---------- */
.audit-status {
    text-align: center;
}

.audit-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.audit-icon-pending {
    background: #fef3c7;
    color: #d97706;
    border: 2px solid #fde68a;
}

.audit-icon-rejected {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

.audit-title {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--primary);
}

.audit-desc {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-sub);
}

.audit-reason {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    font-size: 14px;
    color: #b91c1c;
    text-align: left;
}

.audit-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.audit-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
    color: var(--text-sub);
}

    .audit-info-row span:last-child {
        color: var(--text-main);
        font-weight: 500;
    }

.auth-btn-ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-sub);
}

    .auth-btn-ghost:active {
        background: #f1f5f9;
    }

/* ---------- 移动端适配 ---------- */
@media (max-width: 480px) {
    .auth-main {
        padding: 16px 12px; /* 上下也稍微压缩，让长表单能更多显示 */
    }

    .auth-header-brand {
        padding: 24px 16px 20px;
    }

    .auth-brand-logo {
        height: 60px;
    }

    .auth-body {
        padding: 20px 16px; /* 表单左右留白减小 */
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-input-wrap input {
        padding: 12px;
    }
}

@media (min-width: 768px) {
    .auth-header-brand {
        padding: 40px 32px 28px;
    }

    .auth-body {
        padding: 36px 32px 30px;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
