/* ============================================================
 * assets/css/index.css — 前台页面公共样式
 * ============================================================
 * 系统名称 : 白遇光 · 授权代表服务自助办理系统
 * 开发者 : 白遇光
 * 创建时间 : 2026-04-03
 * 更新时间 : 2026-04-04  迁移至 Bootstrap 5，补充自定义组件样式
 * 说    明 : 承载前台向导、动画、步骤状态、模态层、Hero 区等自定义样式。
 *            Bootstrap 5 基础类由 CDN 提供，本文件仅补充框架未覆盖的部分。
 * ============================================================ */

/* ── CSS 变量 ──────────────────────────────────────────────── */
:root {
    --brand-primary: #165DFF;
    --brand-secondary: #0A2463;
    --brand-primary-rgb: 22, 93, 255;
    --neutral-100: #F5F7FA;
    --neutral-200: #E4E7ED;
    --neutral-300: #C0C6CF;
    --neutral-400: #909399;
    --neutral-500: #606266;
    --neutral-600: #303133;
}

/* ── 通用工具 ──────────────────────────────────────────────── */
.content-auto {
    content-visibility: auto;
}

/* ── 动画 ──────────────────────────────────────────────────── */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

/* ── Hero 区 ───────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.25;
}

/* ── 顶部品牌图标（导航栏小尺寸）────────────────────────── */
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #4F8BFF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(var(--brand-primary-rgb), 0.18);
    flex-shrink: 0;
}

.brand-icon i {
    font-size: 1rem;
    color: #fff;
}

/* ── 服务功能图标 ──────────────────────────────────────────── */
.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(var(--brand-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--brand-primary);
    flex-shrink: 0;
}

/* ── 服务卡片 ──────────────────────────────────────────────── */
.service-card {
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}

.service-card:hover {
    box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb), 0.10);
    transform: translateY(-2px);
}

/* ── 步骤指示器 ────────────────────────────────────────────── */
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.step-active {
    background-color: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.step-inactive {
    background-color: #fff;
    color: var(--neutral-400);
    border-color: var(--neutral-200);
}

.step-completed {
    background-color: rgba(var(--brand-primary-rgb), 0.10);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* 步骤连接线（兼容当前 index.html 中的 .step-line 结构） */
.step-connector {
    flex: 1;
    height: 2px;
    background: var(--neutral-200);
    margin: 0 8px;
    margin-top: 18px;
    transition: background-color 0.3s;
}

.step-connector.step-connector-active {
    background: var(--brand-primary);
}

.step-line {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    transform: translateY(-50%);
    width: clamp(72px, 12vw, 180px);
    height: 2px;
    border-radius: 999px;
}

/* ── 自定义模态遮罩层 ──────────────────────────────────────── */
/* 使用自定义 modal-overlay 而非 Bootstrap modal 组件，
   以保持原有 JS 逻辑（classList.add/remove('d-none')）不变。 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* 登录 / 注册弹窗使用更紧凑的宽度，避免占满整屏 */
.modal-box-auth {
    max-width: 520px;
}

.modal-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.modal-box-header h3,
.modal-box-header .modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--neutral-600);
}

.modal-box-body {
    padding: 20px 24px;
}

.modal-box-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ── Toast 通知 ───────────────────────────────────────────── */
.toast-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

/* Bootstrap 自带 .toast，此处补充项目用到的进度条动画 */
.toast-progress {
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: var(--brand-primary);
    transition: width linear;
}

/* ── 表单元素统一聚焦色 ────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
}

/* ── 主色按钮 ─────────────────────────────────────────────── */
.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: #0d4de0;
    --bs-btn-hover-border-color: #0d4de0;
    --bs-btn-active-bg: #0a3dbf;
}

/* ── 实体类型选择卡片 ─────────────────────────────────────── */
.entity-type-card {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    background: #fff;
}

.entity-type-card:hover {
    border-color: rgba(var(--brand-primary-rgb), 0.45) !important;
    box-shadow: 0 8px 20px rgba(var(--brand-primary-rgb), 0.08);
}

.entity-type-card input[type="radio"] {
    accent-color: var(--brand-primary);
}

.entity-type-card:has(input[type="radio"]:checked) {
    border-color: var(--brand-primary) !important;
    background: rgba(var(--brand-primary-rgb), 0.04);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.08);
}

.cursor-pointer {
    cursor: pointer;
}

/* ── 办理记录卡片 ─────────────────────────────────────────── */
.record-card {
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    padding: 16px 20px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.record-card:hover {
    box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb), 0.08);
}

/* ── 前台表格横向显示 ──────────────────────────────────────── */
.table thead th,
.table tbody td {
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* ── 提交记录操作按钮横向排列 ─────────────────────────────── */
.submission-actions {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

/* ── 响应式：小屏折叠步骤文字 ─────────────────────────────── */
@media (max-width: 480px) {
    .step-label {
        display: none;
    }
}
