/* ==========================================
   通用联系表单样式
   可在侧边栏、联系我们页面等复用
   ========================================== */

:root {
    --vc-primary: #FF6A00;
    --vc-primary-dark: #E55D00;
    --vc-accent: #FFB800;
    --vc-text-dark: #333333;
    --vc-text-gray: #666666;
    --vc-text-light: #999999;
    --vc-border: #E5E5E5;
    --vc-bg-light: #F8F9FA;
    --vc-white: #FFFFFF;
    --vc-success: #10B981;
    --vc-error: #EF4444;
    --vc-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --vc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --vc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --vc-shadow-hover: 0 8px 30px rgba(255, 106, 0, 0.15);
    --vc-radius-sm: 6px;
    --vc-radius-md: 12px;
    --vc-transition: all 0.3s ease;
}

/* ==========================================
   联系表单容器
   ========================================== */

.vc-contact-form-widget {
    background: var(--vc-white);
    border-radius: var(--vc-radius-md);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--vc-shadow-sm);
    transition: var(--vc-transition);
    /* border: 2px solid var(--vc-border); */
}

/* .vc-contact-form-widget:hover {
    box-shadow: var(--vc-shadow-md);
    border-color: var(--vc-primary);
} */

/* ==========================================
   表单头部
   ========================================== */

.vc-contact-form-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, var(--vc-primary) 0%, #FF8533 100%);
    position: relative;
    overflow: hidden;
}

.vc-contact-form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.vc-contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.vc-contact-icon svg {
    color: var(--vc-white);
}

.vc-contact-header-text {
    flex: 1;
    min-width: 0;
}

.vc-contact-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--vc-white);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.vc-contact-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.3;
}

/* ==========================================
   表单主体
   ========================================== */

.vc-contact-form {
    padding: 24px;
}

.vc-form-group {
    margin-bottom: 20px;
}

.vc-form-group:last-of-type {
    margin-bottom: 24px;
}

.vc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--vc-text-dark);
    margin-bottom: 8px;
}

.vc-required {
    color: var(--vc-error);
    margin-left: 2px;
}

/* ==========================================
   输入框样式
   ========================================== */

.vc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.vc-input-icon {
    position: absolute;
    left: 14px;
    color: var(--vc-text-light);
    pointer-events: none;
    transition: var(--vc-transition);
    z-index: 1;
}

.vc-input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid var(--vc-border);
    border-radius: var(--vc-radius-sm);
    font-size: 14px;
    color: var(--vc-text-dark);
    transition: var(--vc-transition);
    font-family: inherit;
    background: var(--vc-white);
}

.vc-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--vc-border);
    border-radius: var(--vc-radius-sm);
    font-size: 14px;
    color: var(--vc-text-dark);
    transition: var(--vc-transition);
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    background: var(--vc-white);
}

.vc-input-wrapper input:focus,
.vc-form-group textarea:focus {
    outline: none;
    border-color: var(--vc-primary);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.1);
}

.vc-input-wrapper input:focus + .vc-input-icon,
.vc-input-wrapper:focus-within .vc-input-icon {
    color: var(--vc-primary);
}

.vc-input-wrapper input::placeholder,
.vc-form-group textarea::placeholder {
    color: var(--vc-text-light);
}

/* ==========================================
   提交按钮
   ========================================== */

.vc-contact-submit-btn,
.vc-btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--vc-primary) 0%, #FF8533 100%);
    color: var(--vc-white);
    border: none;
    border-radius: var(--vc-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vc-transition);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.vc-contact-submit-btn::before,
.vc-btn-block::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.vc-contact-submit-btn:hover::before,
.vc-btn-block:hover::before {
    width: 300px;
    height: 300px;
}

.vc-contact-submit-btn:hover,
.vc-btn-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--vc-shadow-hover);
}

.vc-contact-submit-btn:active,
.vc-btn-block:active {
    transform: translateY(0);
}

.vc-contact-submit-btn:disabled,
.vc-btn-block:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.vc-btn-text,
.vc-btn-loading,
.vc-btn-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vc-btn-icon {
    transition: var(--vc-transition);
}

.vc-contact-submit-btn:hover .vc-btn-icon,
.vc-btn-block:hover .vc-btn-icon {
    transform: translateX(4px);
}

/* ==========================================
   加载动画
   ========================================== */

.vc-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 旋转的加载图标 */
.vc-spinner {
    animation: vc-spin 1s linear infinite;
}

@keyframes vc-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 加载文字容器 */
.vc-loading-text {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 三个点的容器 */
.vc-loading-dots {
    display: inline-flex;
    gap: 2px;
    margin-left: 0;
}

/* 单个点的样式和动画 */
.vc-dot {
    display: inline-block;
    animation: vc-dotBlink 1.4s infinite;
    opacity: 0;
}

.vc-dot:nth-child(1) {
    animation-delay: 0s;
}

.vc-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.vc-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* 点的闪烁动画 */
@keyframes vc-dotBlink {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 按钮加载状态时的脉冲效果 */
.vc-btn-loading-state {
    animation: vc-buttonPulse 2s ease-in-out infinite;
}

@keyframes vc-buttonPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 106, 0, 0.45);
    }
}

/* ==========================================
   成功/错误模态框
   ========================================== */

.vc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999; /* 确保在所有元素之上 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vc-modal.active {
    opacity: 1;
    visibility: visible;
}

.vc-modal-overlay {
    position: fixed; /* 改为fixed，确保覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999998; /* 确保在header之上 */
}

.vc-modal-content {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: var(--vc-white);
    border-radius: var(--vc-radius-md);
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 9999999; /* 确保在遮罩层之上 */
}

.vc-modal.active .vc-modal-content {
    transform: scale(1);
    animation: vc-modalBounce 0.5s ease;
}

@keyframes vc-modalBounce {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.vc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vc-bg-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--vc-transition);
    color: var(--vc-text-gray);
}

.vc-modal-close:hover {
    background: var(--vc-primary);
    color: var(--vc-white);
    transform: rotate(90deg);
}

/* 成功模态框内容 */
.vc-modal-success-content {
    text-align: center;
}

.vc-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.1), rgba(255, 106, 0, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vc-successPulse 1s ease;
}

@keyframes vc-successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.vc-success-icon svg {
    color: var(--vc-primary);
    animation: vc-checkDraw 0.5s ease 0.3s both;
}

@keyframes vc-checkDraw {
    from {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.vc-success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--vc-text-dark);
    margin: 0 0 12px;
}

.vc-success-message,
.vc-success-message-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--vc-text-gray);
    margin: 0 auto 24px;
}

.vc-modal-ok-btn {
    width: 100%;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--vc-primary), #FF8533);
    color: var(--vc-white);
    border: none;
    border-radius: var(--vc-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vc-transition);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
}

.vc-modal-ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.35);
}

/* 错误模态框内容 */
.vc-modal-error-content {
    text-align: center;
}

.vc-error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.1), rgba(255, 106, 0, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vc-errorShake 0.5s ease;
}

@keyframes vc-errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.vc-error-icon svg {
    color: var(--vc-primary);
}

.vc-error-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--vc-text-dark);
    margin: 0 0 12px;
}

.vc-error-message-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--vc-text-gray);
    margin: 0 0 28px;
}

.vc-modal-retry-btn {
    width: 100%;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--vc-primary), #FF8533);
    color: var(--vc-white);
    border: none;
    border-radius: var(--vc-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vc-transition);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
}

.vc-modal-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--vc-shadow-hover);
}

/* 响应式 - 模态框 */
@media (max-width: 768px) {
    .vc-modal-content {
        width: 95%;
        padding: 32px 24px;
    }
    
    .vc-success-title,
    .vc-error-title {
        font-size: 20px;
    }
    
    .vc-success-icon,
    .vc-error-icon {
        width: 70px;
        height: 70px;
    }
    
    .vc-success-icon svg,
    .vc-error-icon svg {
        width: 56px;
        height: 56px;
    }
}

/* ==========================================
   响应式设计
   ========================================== */

@media (max-width: 768px) {
    .vc-contact-form-widget {
        padding: 0;
    }
    
    .vc-contact-form-header {
        padding: 20px;
    }
    
    .vc-contact-form {
        padding: 20px;
    }
    
    .vc-contact-icon {
        width: 44px;
        height: 44px;
    }
    
    .vc-contact-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .vc-contact-form-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    
    .vc-contact-icon {
        width: 56px;
        height: 56px;
    }
    
    .vc-input-wrapper input {
        padding-left: 40px;
    }
    
    .vc-input-icon {
        left: 12px;
    }
}

/* ==========================================
   页面级联系表单（大尺寸版本）
   ========================================== */

.vc-contact-form-page {
    max-width: 600px;
    margin: 0 auto;
}

.vc-contact-form-page .vc-contact-form-widget {
    border: none;
    box-shadow: var(--vc-shadow-lg);
}

.vc-contact-form-page .vc-contact-form-header {
    padding: 32px;
}

.vc-contact-form-page .vc-contact-icon {
    width: 64px;
    height: 64px;
}

.vc-contact-form-page .vc-contact-icon svg {
    width: 32px;
    height: 32px;
}

.vc-contact-form-page .vc-contact-title {
    font-size: 28px;
}

.vc-contact-form-page .vc-contact-subtitle {
    font-size: 16px;
}

.vc-contact-form-page .vc-contact-form {
    padding: 32px;
}

.vc-contact-form-page .vc-form-group {
    margin-bottom: 24px;
}

.vc-contact-form-page .vc-form-group label {
    font-size: 15px;
}

.vc-contact-form-page .vc-input-wrapper input,
.vc-contact-form-page .vc-form-group textarea {
    padding: 14px 16px 14px 48px;
    font-size: 15px;
}

.vc-contact-form-page .vc-input-icon {
    left: 16px;
}

.vc-contact-form-page .vc-contact-submit-btn {
    padding: 16px 32px;
    font-size: 16px;
}
