/* Nausys Contact Form - Frontend Styles */

.nausys-contact-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
}

.nausys-contact-form {
    position: relative;
}

/* Rows */
.ncf-row {
    margin-bottom: 20px;
}

.ncf-row-half {
    display: flex;
    gap: 16px;
}

.ncf-row-half .ncf-field {
    flex: 1;
}

/* Labels */
.ncf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.ncf-req {
    color: #e74c3c;
}

/* Inputs, Selects, Textarea */
.nausys-contact-form input[type="text"],
.nausys-contact-form input[type="email"],
.nausys-contact-form input[type="tel"],
.nausys-contact-form select,
.nausys-contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.nausys-contact-form input:focus,
.nausys-contact-form select:focus,
.nausys-contact-form textarea:focus {
    outline: none;
    border-color: #01024d;
    box-shadow: 0 0 0 3px rgba(1, 2, 77, 0.1);
}

.nausys-contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Validation error state */
.nausys-contact-form .ncf-error input,
.nausys-contact-form .ncf-error select,
.nausys-contact-form .ncf-error textarea {
    border-color: #e74c3c;
}

.ncf-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

/* Phone row */
.ncf-phone-wrap {
    display: flex;
    gap: 8px;
}

.ncf-phone-code {
    flex: 0 0 160px;
    min-width: 160px;
}

/* Select2 container inside phone wrap - must not grow */
.ncf-phone-wrap .select2-container {
    flex: 0 0 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
}

.ncf-phone-wrap input[type="tel"] {
    flex: 1;
    min-width: 0;
}

/* Consent row */
.ncf-consent-row {
    margin-bottom: 20px;
}

.ncf-consent-label {
    display: inline-flex !important;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400 !important;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
}

.ncf-consent-label input[type="checkbox"] {
    width: auto;
    height: 17px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Submit button */
.ncf-submit {
    display: inline-block;
    background: #01024d;
    color: #fff;
    border: none;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.ncf-submit:hover {
    background: #020380;
}

.ncf-submit:active {
    transform: scale(0.98);
}

.ncf-submit:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

/* Feedback message */
.ncf-feedback {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.ncf-feedback-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ncf-feedback-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Flatpickr overrides */
.nausys-contact-form .flatpickr-input {
    background: #fff;
    cursor: pointer;
}

.flatpickr-calendar {
    font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange {
    background: #01024d;
    border-color: #01024d;
}

.flatpickr-day.inRange {
    background: rgba(1, 2, 77, 0.1);
    border-color: rgba(1, 2, 77, 0.1);
    box-shadow: -5px 0 0 rgba(1, 2, 77, 0.1), 5px 0 0 rgba(1, 2, 77, 0.1);
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #020380;
    border-color: #020380;
}

/* Clickable month name */
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month span.cur-month {
    cursor: pointer;
}

.flatpickr-current-month span.cur-month:hover {
    text-decoration: underline;
}

/* Loading spinner */
.ncf-submit .ncf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ncf-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* Responsive */
@media (max-width: 600px) {
    .ncf-row-half {
        flex-direction: column;
        gap: 0;
    }

    .ncf-phone-code,
    .ncf-phone-wrap .select2-container {
        flex: 0 0 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
    }
}
