/**
 * Frontend styles for NFP Business Application Form
 */

.nfp-business-application-form-wrapper {
    max-width: 700px;
    margin: 2rem auto;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.nfp-business-form-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #000 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 8px 8px 0 0;
}

.nfp-business-form-header h2 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    color: #fff !important;
}

.nfp-business-form-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
    color: #fff;
}

.nfp-business-form {
    padding: 2rem;
    background: #fff;
}

.nfp-form-row {
    margin-bottom: 1.5rem;
}

.nfp-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.nfp-form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.nfp-form-row label.nfp-required::after {
    content: ' *';
    color: #dc3232;
}

.nfp-form-row input[type="text"],
.nfp-form-row input[type="email"],
.nfp-form-row input[type="tel"],
.nfp-form-row input[type="url"],
.nfp-form-row select,
.nfp-form-row textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.nfp-form-row select {
    cursor: pointer;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.nfp-form-row input:focus,
.nfp-form-row select:focus,
.nfp-form-row textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nfp-form-row input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.nfp-form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.nfp-field-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.nfp-submit-button {
    width: 100% !important;
    padding: 1rem !important;
    background: linear-gradient(135deg, #1f1f1f 0%, #000 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.nfp-submit-button:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(197, 15, 15, 0.4) !important;
}

.nfp-submit-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.nfp-button-loading {
    display: inline-block;
}

.nfp-form-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f0f4ff;
    border-left: 3px solid #667eea;
    border-radius: 4px;
}

.nfp-form-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

/* Form messages */
.nfp-form-messages {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.nfp-form-messages.nfp-success {
    display: block;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.nfp-form-messages.nfp-error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.nfp-form-messages p {
    margin: 0;
    font-size: 0.95rem;
}

/* Field errors */
.nfp-field-error {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1) !important;
}

.nfp-field-error-message {
    display: block;
    margin-top: 0.25rem;
    color: #dc3232;
    font-size: 0.85rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nfp-business-application-form-wrapper {
        margin: 0;
        border-radius: 4px;
    }

    .nfp-business-form-header {
        padding: 1.5rem;
        border-radius: 4px 4px 0 0;
    }

    .nfp-business-form-header h2 {
        font-size: 1.5rem;
    }

    .nfp-business-form {
        padding: 1.5rem;
    }

    .nfp-form-row-half {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .nfp-business-form-header {
        padding: 1rem;
    }

    .nfp-business-form-header h2 {
        font-size: 1.25rem;
    }

    .nfp-business-form {
        padding: 1rem;
    }

    .nfp-submit-button {
        padding: 0.875rem;
        font-size: 1rem;
    }
}

/* Loading animation */
@keyframes nfp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nfp-button-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nfp-spin 0.8s linear infinite;
    vertical-align: middle;
}

/* VAT Validation Styles */
.nfp-field-validating {
    border-color: #667eea !important;
    background-color: #f9fafb !important;
}

.nfp-field-valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.nfp-field-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.nfp-field-warning {
    border-color: #f59e0b !important;
    background-color: #fffbeb !important;
}

/* Live Format Validation (before API validation) */
.nfp-field-format-valid {
    border-color: #10b981 !important;
}

.nfp-field-format-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Validation Indicator */
.nfp-validation-indicator {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
}

.nfp-validation-indicator.nfp-validating {
    color: #667eea;
    background-color: #f0f4ff;
    border-left: 3px solid #667eea;
}

.nfp-validation-indicator.nfp-validating::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: nfp-spin 0.8s linear infinite;
    vertical-align: middle;
}

.nfp-validation-indicator.nfp-valid {
    color: #047857;
    background-color: #d1fae5;
    border-left: 3px solid #10b981;
}

.nfp-validation-indicator.nfp-invalid {
    color: #b91c1c;
    background-color: #fee2e2;
    border-left: 3px solid #ef4444;
}

.nfp-validation-indicator.nfp-warning {
    color: #b45309;
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
}

/* Company Info Display */
.nfp-company-info {
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #065f46;
    line-height: 1.6;
}

.nfp-company-info strong {
    color: #047857;
    font-weight: 600;
}

/* Smooth transitions for validation states */
.nfp-form-row input[type="text"],
.nfp-form-row input[type="email"] {
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

/* Auto-filled field animation */
.nfp-field-autofilled {
    animation: nfp-autofill-pulse 2s ease-in-out;
    border-color: #10b981 !important;
}

@keyframes nfp-autofill-pulse {
    0% {
        background-color: #d1fae5;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    }
    50% {
        background-color: #a7f3d0;
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.3);
    }
    100% {
        background-color: #fff;
        box-shadow: none;
    }
}
