/*
 * 白皮书留资弹窗 (whitepaper-popup)
 * 与 demo-popup 风格保持一致，但区别用：弹窗 accent 色 = 蓝色（次 CTA 性质）
 * 字段：姓名 / 公司 / 邮箱 / 电话 / 关注产品(下拉) / 用途说明
 * 提交：POST /api/whitepaper-request
 */

.wp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 16px;
}

.wp-popup-overlay.show {
    display: flex;
    opacity: 1;
}

.wp-popup-container {
    position: relative;
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-radius: 16px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 154, 206, 0.25);
    border: 1px solid rgba(0, 154, 206, 0.25);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.wp-popup-overlay.show .wp-popup-container {
    transform: scale(1);
}

.wp-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wp-popup-close:hover {
    background: rgba(0, 154, 206, 0.35);
    transform: rotate(90deg);
}

.wp-popup-header {
    text-align: left;
    margin-bottom: 24px;
    padding-right: 32px;
}

.wp-popup-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 154, 206, 0.18);
    color: #00e5ff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.wp-popup-title {
    font-size: 24px;
    color: #f0f6fc;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.25;
}

.wp-popup-subtitle {
    font-size: 14px;
    color: #8b949e;
    line-height: 1.6;
}

.wp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wp-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 540px) {
    .wp-form-row { grid-template-columns: 1fr 1fr; }
}

.wp-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wp-form-label {
    font-size: 13px;
    color: #8b949e;
    font-weight: 500;
}

.wp-form-label .required {
    color: #f85149;
    margin-left: 4px;
}

.wp-form-input,
.wp-form-select,
.wp-form-textarea {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f0f6fc;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.wp-form-input:focus,
.wp-form-select:focus,
.wp-form-textarea:focus {
    outline: none;
    border-color: #009ace;
    background: rgba(0, 154, 206, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 154, 206, 0.18);
}

.wp-form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238b949e' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.wp-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.wp-form-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #8b949e;
    line-height: 1.5;
}

.wp-form-agree input[type=checkbox] {
    margin-top: 3px;
    accent-color: #f04d1e;
    flex-shrink: 0;
}

.wp-form-agree a {
    color: #009ace;
    text-decoration: none;
}

.wp-form-agree a:hover { color: #00e5ff; }

.wp-form-submit {
    margin-top: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f04d1e 0%, #d9421a 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wp-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(240, 77, 30, 0.35);
}

.wp-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wp-form-note {
    font-size: 11px;
    color: #6e7681;
    text-align: center;
    margin-top: 4px;
    line-height: 1.5;
}

/* 成功状态 */
.wp-success {
    text-align: center;
    padding: 32px 16px;
}

.wp-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(63, 185, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3fb950;
    font-size: 30px;
}

.wp-success-title {
    font-size: 20px;
    color: #f0f6fc;
    margin-bottom: 8px;
    font-weight: 600;
}

.wp-success-desc {
    font-size: 14px;
    color: #8b949e;
    line-height: 1.6;
}

/* 错误提示 */
.wp-error {
    padding: 10px 12px;
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.35);
    border-radius: 6px;
    color: #f85149;
    font-size: 13px;
    display: none;
}

.wp-error.show { display: block; }

/* 媒体查询：移动端调整 */
@media (max-width: 540px) {
    .wp-popup-container {
        padding: 28px 20px;
        border-radius: 12px;
    }
    .wp-popup-title { font-size: 20px; }
}
