/**
 * NEX-CRM - 前台样式
 */

:root {
    --nex-primary: #2c7da0;
    --nex-primary-dark: #1a4a6e;
    --nex-primary-light: #61a5c2;
    --nex-secondary: #64748b;
    --nex-success: #10b981;
    --nex-danger: #ef4444;
    --nex-warning: #f59e0b;
    --nex-info: #3b82f6;
    --nex-bg-light: #f8fafc;
    --nex-bg-dark: #1e293b;
    --nex-text: #1e293b;
    --nex-text-light: #64748b;
    --nex-border: #e2e8f0;
    --nex-radius-sm: 8px;
    --nex-radius-md: 12px;
    --nex-radius-lg: 16px;
    --nex-radius-xl: 24px;
    --nex-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --nex-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --nex-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --nex-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.nex-crm-form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
}

.nex-crm-form-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: transparent;
}

.nex-crm-form-container.submitting {
    opacity: 0.6;
    pointer-events: none;
}

.nex-crm-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.nex-crm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nex-crm-label {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--nex-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nex-crm-required {
    color: var(--nex-danger);
    font-size: 16px;
}

.nex-crm-input {
    padding: 12px 16px;
    border-radius: var(--nex-radius-md);
    transition: all 0.2s ease;
    font-size: 15px;
    border: 1.5px solid var(--nex-border);
    background: #ffffff;
    width: 100%;
    font-family: inherit;
    color: var(--nex-text);
}

.nex-crm-input:focus {
    outline: none;
    border-color: var(--nex-primary);
    box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.1);
    transform: translateY(-1px);
}

.nex-crm-input:hover:not(:focus) {
    border-color: var(--nex-primary-light);
}

.nex-crm-textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

.nex-crm-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

.nex-crm-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: var(--nex-radius-md);
    border: 1.5px solid var(--nex-border);
}

.nex-crm-radio-label,
.nex-crm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--nex-text);
    transition: all 0.2s;
}

.nex-crm-radio-label:hover,
.nex-crm-checkbox-label:hover {
    color: var(--nex-primary);
}

.nex-crm-radio-label input,
.nex-crm-checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--nex-primary);
}

.nex-crm-file {
    padding: 10px 12px;
    cursor: pointer;
}

.nex-crm-file::-webkit-file-upload-button {
    padding: 8px 16px;
    border-radius: var(--nex-radius-sm);
    border: none;
    background: var(--nex-primary);
    color: white;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
}

.nex-crm-file::-webkit-file-upload-button:hover {
    background: var(--nex-primary-dark);
    transform: translateY(-1px);
}

.nex-crm-help {
    font-size: 12px;
    margin-top: 6px;
    color: var(--nex-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nex-crm-button {
    padding: 14px 32px;
    border: none;
    border-radius: var(--nex-radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--nex-primary) 0%, var(--nex-primary-dark) 100%);
    color: white;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: 160px;
}

.nex-crm-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--nex-shadow-lg);
    filter: brightness(1.05);
}

.nex-crm-button:active {
    transform: translateY(0);
}

.nex-crm-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.nex-crm-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.nex-crm-button.loading .button-text {
    visibility: hidden;
}

.nex-crm-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: nex-spin 0.6s linear infinite;
}

@keyframes nex-spin {
    to { transform: rotate(360deg); }
}

.nex-crm-success-message {
    padding: 20px 24px;
    border-radius: var(--nex-radius-lg);
    margin-bottom: 24px;
    font-size: 15px;
    text-align: center;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
    animation: nex-slide-down 0.5s ease;
}

.nex-crm-error-message {
    padding: 16px 20px;
    border-radius: var(--nex-radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
    animation: nex-slide-down 0.5s ease;
}

@keyframes nex-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nex-crm-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.nex-crm-file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

.nex-crm-counter {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-align: right;
}

@media (max-width: 768px) {
    .nex-crm-fields {
        gap: 18px;
    }
    
    .nex-crm-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .nex-crm-button {
        width: 100%;
        padding: 12px 24px;
    }
}