/* ==========================================================================
   登录/注册页蓝紫薄荷渐变风格覆盖层
   引入位置：auth.php backend.css 之后
   ========================================================================== */

/* ---- 渐变背景 ---- */
body.auth-body {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f6ff 35%, #f4ecff 70%, #f0fdf4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ---- 玻璃卡片 ---- */
.auth-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: 24px;
    box-shadow:
        0 24px 60px rgba(90, 102, 255, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.65);
    padding: 36px 32px;
    animation: authCardIn .6s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(28px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 品牌标题渐变 ---- */
.auth-brand { text-align: center; margin-bottom: 26px; }

.auth-brand h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(90deg, #5a66ff, #c148a8, #e53e67, #e5c600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand p {
    margin: 0;
    color: #6b72a0;
    font-size: 13px;
}

/* ---- 表单美化 ---- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-form h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    background: linear-gradient(90deg, #5a66ff, #c148a8, #e53e67);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}



.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"],
.auth-form select,
.auth-form textarea {
    padding: 12px 16px;
    border: 1.5px solid #dbe0f0;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c2e45;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    outline: none;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 4px rgba(90, 102, 255, 0.12);
    transform: translateY(-1px);
}

.auth-form input::placeholder {
    color: #aab2d1;
}

/* ---- 表单：标签左对齐 ---- */
.auth-form .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.auth-form .form-group > label {
    min-width: 110px;
    max-width: 140px;
    text-align: right;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #4a4f7a;
    padding-inline-end: 8px;
}

.auth-form .form-group > input,
.auth-form .form-group > select,
.auth-form .form-group > textarea {
    flex: 1;
    min-width: 0;
}

/* 全宽组（地区等）保持纵向 */
.auth-form .form-group.form-full {
    flex-direction: column;
    align-items: stretch;
}
.auth-form .form-group.form-full > label {
    max-width: none;
    text-align: left;
}

/* 文件上传保持纵向 */
.auth-form .form-group.file-upload-group {
    flex-direction: column;
    align-items: stretch;
}
.auth-form .form-group.file-upload-group > label:first-child {
    max-width: none;
    text-align: left;
}

/* ---- 密码框 + 查看按钮 ---- */
.pwd-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.pwd-wrap input[type="password"],
.pwd-wrap input[type="text"] {
    flex: 1;
    padding-right: 44px !important;
}

.pwd-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    line-height: 1;
    opacity: 0.55;
    transition: opacity .2s;
    z-index: 1;
}

.pwd-toggle:hover { opacity: 1; }

/* 文件上传框 */
.auth-form input[type="file"] {
    padding: 10px 14px;
    cursor: pointer;
}

/* ---- 地区选择行 ---- */
.region-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.region-row select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #dbe0f0;
    background: rgba(255,255,255,.9);
    color: #2c2e45;
    font-size: 14px;
}

.region-row select:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(90,102,255,.10);
}


/* ---- 文件上传自定义按钮 ---- */
.auth-form input[type="file"] {
    display: none;
}

.file-upload-group {
    gap: 8px;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: border-color .25s, background .25s, box-shadow .25s, transform .15s;
}

.file-upload-btn:hover {
    border-color: #a5b4fc;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(90, 102, 255, 0.08);
    transform: translateY(-1px);
}

.file-upload-btn .file-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #5a66ff, #c148a8);
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.file-upload-btn .file-text {
    font-size: 14px;
    color: #4a4f7a;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- 协议勾选 ---- */
.agreement-section {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(90, 102, 255, 0.12);
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 4px;
}

.agree-all {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(90, 102, 255, 0.10);
}

.agree-all .check-text {
    font-weight: 700;
    color: #2c2e45;
}

.agree-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agree-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #4a4f7a;
}

.agree-check input[type="checkbox"] {
    display: none;
}

.check-box {
    width: 18px; height: 18px;
    border: 2px solid #c7d2fe;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s, box-shadow .2s;
    flex-shrink: 0;
}

.check-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .2s, transform .2s;
}

.agree-check input:checked + .check-box {
    border-color: #5a66ff;
    background: linear-gradient(135deg, #5a66ff, #c148a8);
    box-shadow: 0 2px 8px rgba(90, 102, 255, 0.25);
}

.agree-check input:checked + .check-box::after {
    opacity: 1;
    transform: scale(1);
}

.check-text {
    user-select: none;
    line-height: 1.4;
}

.agree-link {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
}

.agree-link a {
    color: #5a66ff;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
}

.agree-link a:hover {
    color: #c148a8;
}

.agree-link i {
    margin-inline-end: 4px;
}

/* ---- 按钮 ---- */
.form-actions {
    margin-top: 6px;
}

.btn-primary.btn-block {
    display: block;
    width: 100%;
    padding: 13px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #5a66ff, #c148a8);
    box-shadow: 0 6px 20px rgba(90, 102, 255, 0.35);
    transition: transform .2s, box-shadow .2s, filter .2s;
}

.btn-primary.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(90, 102, 255, 0.45);
    filter: brightness(1.08);
}

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

/* ---- 链接 ---- */
.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #6b72a0;
}

.auth-links a {
    color: #5a66ff;
    text-decoration: none;
    font-weight: 600;
    margin: 0 8px;
    transition: color .2s;
    position: relative;
}

.auth-links a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, #5a66ff, #c148a8);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .25s;
}

.auth-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.auth-links a:hover {
    color: #c148a8;
}

/* ---- 页脚 ---- */
.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: #8a90b8;
    letter-spacing: .3px;
}

/* ---- 语言切换 ---- */
.lang-switch {
    margin-top: 12px;
    font-size: 13px;
    color: #6b72a0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-link:hover { color: #5a66ff; }

/* ---- 错误提示 ---- */
.alert.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #c12b2b;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
}

/* ---- 响应式 ---- */
@media (max-width: 520px) {
    .auth-card { padding: 26px 20px; border-radius: 20px; }
    .auth-brand h1 { font-size: 22px; }
    .auth-form h2 { font-size: 18px; }
    .region-row { gap: 8px; }
}

/* ---- 手机版优化（窄屏） ---- */
@media (max-width: 520px) {
    .auth-card { padding: 24px 18px; border-radius: 18px; }
    .auth-brand h1 { font-size: 21px; }
    .auth-form h2 { font-size: 18px; }

    /* 地区 4 个下拉框在窄屏改为 2x2，避免过窄 */
    .region-row { display: grid !important; grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
    .region-row select { min-height: 42px !important; font-size: 13px !important; }

    /* 触屏友好：按钮与输入框最小点击高度 */
    .btn-primary, .btn-block { min-height: 46px; }
    .form-group > input,
    .form-group > select,
    .pwd-wrap > input { min-height: 44px; }

    /* 标签左对齐时，窄屏改为上下堆叠更清晰 */
    .auth-form .form-group { flex-direction: column; align-items: stretch; gap: 6px; }
    .auth-form .form-group > label { min-width: 0; max-width: none; text-align: start; }
}


/* ===== AUTH ICON INPUTS v2 ===== */
.auth-header {
    text-align: center;
    margin-bottom: 8px;
}
.auth-logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}
.auth-form h2 {
    font-size: 20px !important;
    margin-bottom: 4px !important;
}
.auth-subtitle {
    font-size: 13px;
    color: #888;
    margin-top: 0;
}

/* Icon input group - horizontal flex with icon inside */
.input-icon-group {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
}
.input-icon-group .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e84b3;
    font-size: 15px;
    z-index: 2;
    pointer-events: none;
    transition: color 0.2s;
}
.input-icon-group input {
    padding-right: 42px !important;
    padding-left: 14px !important;
    min-height: 46px !important;
    border-radius: 10px !important;
    border: 1.5px solid #ddd6ed !important;
    background: #fafaff !important;
    transition: all 0.25s !important;
    width: 100% !important;
    flex: 1 !important;
}
.input-icon-group input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12) !important;
    background: #fff !important;
}
.input-icon-group input:focus + .input-icon,
.input-icon-group input:focus ~ .input-icon,
.input-icon-group:focus-within .input-icon {
    color: #667eea !important;
}

/* Password wrap inside icon group */
.input-icon-group .pwd-wrap {
    flex: 1;
    display: flex;
    position: relative;
}
.input-icon-group .pwd-wrap input {
    width: 100% !important;
    flex: 1 !important;
}

/* Select with icon */
.select-icon-group {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}
.select-icon-group .input-icon-left {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e84b3;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}
.select-icon-group select {
    padding-right: 38px !important;
    min-height: 46px !important;
    border-radius: 10px !important;
    border: 1.5px solid #ddd6ed !important;
    background: #fafaff !important;
    appearance: none;
    flex: 1 !important;
    width: 100% !important;
}
.select-icon-group select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12) !important;
}

/* Region group label icon */
.region-group label i {
    color: #764ba2;
    margin-left: 4px;
}

/* Button with icon */
.btn-primary.btn-block i {
    margin-left: 6px;
}

/* Auth links with icons */
.auth-links a i {
    margin-left: 4px;
    font-size: 13px;
}

/* Pwd toggle icon style */
.pwd-toggle i {
    font-size: 14px;
    color: #999;
}
.pwd-toggle:hover i {
    color: #667eea;
}

/* Register form specific */
.auth-form-register .form-group {
    margin-bottom: 4px;
}

/* Mobile responsive */
@media(max-width:520px) {
    .auth-logo-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 12px;
    }
    .input-icon-group input,
    .select-icon-group select {
        min-height: 44px !important;
    }
    .input-icon-group .input-icon {
        right: 12px;
        font-size: 14px;
    }
}

/* Fix region row layout */
.region-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}
.region-row select {
    width: 100% !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    border: 1.5px solid #ddd6ed !important;
    background: #fafaff !important;
    color: #2c2e45 !important;
    font-size: 14px !important;
    min-height: 44px !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238e84b3'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px !important;
}

/* Fix agree check */
.agree-check {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    color: #4a4f7a !important;
    padding: 8px 0 !important;
}
.agree-check span {
    line-height: 1.4 !important;
}
.agree-check span a {
    color: #667eea !important;
    text-decoration: underline !important;
}

@media(max-width:520px) {
    .region-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .region-row select {
        min-height: 42px !important;
        font-size: 13px !important;
        padding-left: 26px !important;
    }
}


/* ===== FIX REGION-ROW LAYOUT v3 ===== */
.region-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
}
.region-row > select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}
@media(max-width:520px) {
    .region-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
}

/* ===== FIX AGREE-CHECK v3 ===== */
.agree-check {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    color: #4a4f7a !important;
    padding: 10px 0 !important;
    flex-wrap: nowrap !important;
    direction: rtl !important;
}
.agree-check > input[type="checkbox"] {
    display: none !important;
}
.agree-check > .check-box {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border: 2px solid #c7d2fe !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    background: #fff !important;
    margin-top: 1px !important;
}
.agree-check > input:checked + .check-box {
    border-color: #5a66ff !important;
    background: linear-gradient(135deg, #5a66ff, #c148a8) !important;
    box-shadow: 0 2px 8px rgba(90, 102, 255, 0.25) !important;
}
.agree-check > .check-box::after {
    content: "\f00c" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 11px !important;
    color: #fff !important;
    opacity: 0 !important;
    transform: scale(.6) !important;
    transition: opacity .2s, transform .2s !important;
}
.agree-check > input:checked + .check-box::after {
    opacity: 1 !important;
    transform: scale(1) !important;
}
.agree-check > span {
    flex: 1 !important;
    line-height: 1.5 !important;
    user-select: none !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
.agree-check > span > a {
    color: #667eea !important;
    text-decoration: underline !important;
    display: inline !important;
    word-break: keep-all !important;
}


/* ===== SELECT PLACEHOLDER STYLE v4 ===== */
.region-row > select {
    color: #6b7280 !important;
}
.region-row > select.has-value {
    color: #2c2e45 !important;
}
.region-row > select option[value=""] {
    color: #9ca3af !important;
}
.region-row > select option:not([value=""]) {
    color: #2c2e45 !important;
}

/* Equal width force */
.region-row > select {
    min-width: 0 !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    padding-right: 28px !important;
    padding-left: 12px !important;
    box-sizing: border-box !important;
}

/* Ensure both rows aligned */
.region-row > select:nth-child(odd) {
    grid-column: 1 !important;
}
.region-row > select:nth-child(even) {
    grid-column: 2 !important;
}
