/**
 * 试用申请弹窗公共样式。
 * 由 apply-form.js 动态生成的表单 DOM 使用本文件样式。
 */

/* ─── 遮罩层 ─── */
.apply-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}
.apply-overlay.show {
    display: flex;
}

/* ─── 弹窗容器 ─── */
.apply-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px 24px;
    width: 520px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

/* ─── 关闭按钮 ─── */
.apply-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.apply-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ─── 标题 ─── */
.apply-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: left;
}

/* ─── 表单 ─── */
.apply-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── 字段标签 ─── */
.apply-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}
.apply-field .required {
    color: #e53e3e;
    margin-right: 2px;
}

/* ─── 输入框 / 下拉 ─── */
.apply-field input[type="text"],
.apply-field select {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #e6e8ed;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: #fff;
}
.apply-field input[type="text"]:focus,
.apply-field select:focus {
    border-color: #002fa8;
}
.apply-field input[type="text"].error,
.apply-field select.error {
    border-color: #e53e3e;
}

.apply-field select.applyphone-code {
    max-width: 120px;
}

/* ─── 行内组合（手机号、验证码） ─── */
.apply-row {
    display: flex;
    gap: 8px;
}
.apply-row .apply-phone-code {
    max-width: 160px;
    flex-shrink: 0;
}
.apply-row input[type="text"] {
    flex: 1;
}

/* ─── 发送验证码按钮 ─── */
.apply-send-code {
    flex-shrink: 0;
    padding: 0 14px;
    height: 34px;
    border: 1px solid #666;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
}
.apply-send-code:hover:not(:disabled) {
    border-color: #002fa8;
    color: #002fa8;
}
.apply-send-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── 自定义部门输入 ─── */
.apply-dept-custom {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #e6e8ed;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    margin-top: 8px;
    display: none;
    box-sizing: border-box;
}
.apply-dept-custom.error {
    border-color: #e53e3e;
}

/* ─── 错误提示 ─── */
.apply-error {
    font-size: 12px;
    color: #e53e3e;
    margin-top: 4px;
    min-height: 0;
}

/* ─── 手机号整行错误 ─── */
.apply-row.error input[type="text"] {
    border-color: #e53e3e;
}

/* ─── 协议 ─── */
.apply-agree {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: #333;
    line-height: 1.5;
    cursor: pointer;
}
.apply-agree input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
    cursor: pointer;
}
.apply-agree a {
    color: #002fa8;
    text-decoration: none;
}
.apply-agree a:hover {
    text-decoration: underline;
}
.apply-agree-error {
    display: none;
    font-size: 12px;
    color: #e53e3e;
    margin-top: -8px;
}

/* ─── 提交按钮 ─── */
.apply-submit-wrap {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}
.apply-submit {
    width: 180px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #002fa8;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.apply-submit:hover:not(:disabled) {
    background: #1451cc;
}
.apply-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Toast 提示 ─── */
.apply-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.apply-toast.show {
    opacity: 1;
}
.apply-toast.success {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}
.apply-toast.error {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .apply-dialog {
        width: 92%;
    }
}
