/**
 * Whalet Payment 前端表单样式
 * 客户信息收集表单的样式定义
 */

/* 客户信息表单容器 */
.whalet-customer-form {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    max-height: 70vh;
    overflow-y: auto;
}

.whalet-customer-form h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.whalet-customer-form h5 {
    margin: 20px 0 10px 0;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表单组 */
.whalet-form-group {
    margin-bottom: 16px;
}

.whalet-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.whalet-form-group label::after {
    content: '';
}

.whalet-form-group label:has(+ input[required])::after,
.whalet-form-group label:has(+ select[required])::after {
    content: ' *';
    color: #e74c3c;
}

/* 输入框样式 */
.whalet-form-group input,
.whalet-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.whalet-form-group input:focus,
.whalet-form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.whalet-form-group input:invalid {
    border-color: #e74c3c;
}

.whalet-form-group input:invalid:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* 占位符样式 */
.whalet-form-group input::placeholder {
    color: #999;
    opacity: 1;
}

/* 表单行布局 */
.whalet-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.whalet-form-half {
    flex: 1;
    margin-bottom: 0;
}

/* 表单分组 */
.whalet-form-section {
    margin: 24px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.whalet-form-section:first-of-type {
    margin-top: 16px;
}

/* 按钮样式 */
.whalet-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.whalet-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.whalet-btn-primary {
    background-color: #007cba;
    color: white;
}

.whalet-btn-primary:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.whalet-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.3);
}

.whalet-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.whalet-btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.whalet-btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .whalet-customer-form {
        padding: 16px;
        max-height: 80vh;
    }

    .whalet-form-row {
        flex-direction: column;
        gap: 0;
    }

    .whalet-form-half {
        margin-bottom: 16px;
    }

    .whalet-form-actions {
        flex-direction: column;
    }

    .whalet-btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .whalet-customer-form h4 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .whalet-customer-form {
        padding: 12px;
        max-height: 85vh;
    }

    .whalet-form-group input,
    .whalet-form-group select {
        padding: 10px 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .whalet-form-section {
        padding: 12px;
        margin: 16px 0;
    }
}

/* 加载状态 */
.whalet-form-loading .whalet-btn {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 错误状态 */
.whalet-form-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.whalet-form-group.has-error input,
.whalet-form-group.has-error select {
    border-color: #e74c3c;
}

.whalet-form-group.has-error .whalet-form-error {
    display: block;
}

/* 成功状态 */
.whalet-form-group.has-success input,
.whalet-form-group.has-success select {
    border-color: #27ae60;
}

/* 选择框特殊样式 */
.whalet-form-group select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 数字输入框 */
.whalet-form-group input[type="number"] {
    -moz-appearance: textfield;
}

.whalet-form-group input[type="number"]::-webkit-outer-spin-button,
.whalet-form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 动画效果 */
.whalet-customer-form {
    animation: slideInUp 0.3s ease-out;
}

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

/* 滚动条样式 */
.whalet-customer-form::-webkit-scrollbar {
    width: 6px;
}

.whalet-customer-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.whalet-customer-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.whalet-customer-form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
