/* ========================================
   SP Contact Form - Public Styles
   ======================================== */

.sp-cf-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    font-family: inherit;
}

.sp-cf-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Rows */
.sp-cf-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.sp-cf-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Fields */
.sp-cf-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Inputs */
.sp-cf-form input[type="text"],
.sp-cf-form input[type="email"],
.sp-cf-form input[type="tel"] {
    width: 100%;
    padding: 18px 30px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 100px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.sp-cf-form input[type="text"]::placeholder,
.sp-cf-form input[type="email"]::placeholder,
.sp-cf-form input[type="tel"]::placeholder {
    color: #999;
}

.sp-cf-form input[type="text"]:hover,
.sp-cf-form input[type="email"]:hover,
.sp-cf-form input[type="tel"]:hover {
    border-color: #bbb;
}

.sp-cf-form input[type="text"]:focus,
.sp-cf-form input[type="email"]:focus,
.sp-cf-form input[type="tel"]:focus {
    border-color: #4A90D9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

/* Textarea */
.sp-cf-form textarea {
    width: 100%;
    padding: 18px 30px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    resize: vertical;
    min-height: 140px;
    -webkit-appearance: none;
    appearance: none;
}

.sp-cf-form textarea::placeholder {
    color: #999;
}

.sp-cf-form textarea:hover {
    border-color: #bbb;
}

.sp-cf-form textarea:focus {
    border-color: #4A90D9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

/* Error state */
.sp-cf-field.sp-cf-has-error input,
.sp-cf-field.sp-cf-has-error textarea {
    border-color: #e74c3c;
}

.sp-cf-field.sp-cf-has-error input:focus,
.sp-cf-field.sp-cf-has-error textarea:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.sp-cf-error {
    display: none;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    padding-left: 30px;
}

.sp-cf-field.sp-cf-has-error .sp-cf-error {
    display: block;
}

/* GDPR Checkbox */
.sp-cf-gdpr-field {
    display: flex;
    flex-direction: column;
}

.sp-cf-gdpr-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    position: relative;
    padding-left: 0;
}

.sp-cf-gdpr-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-cf-gdpr-checkmark {
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
    margin-top: 2px;
}

.sp-cf-gdpr-label:hover .sp-cf-gdpr-checkmark {
    border-color: #bbb;
}

.sp-cf-gdpr-label input[type="checkbox"]:checked + .sp-cf-gdpr-checkmark {
    background: #4A90D9;
    border-color: #4A90D9;
}

.sp-cf-gdpr-label input[type="checkbox"]:checked + .sp-cf-gdpr-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sp-cf-gdpr-text {
    flex: 1;
}

.sp-cf-gdpr-text a {
    color: #4A90D9;
    text-decoration: underline;
}

.sp-cf-gdpr-text a:hover {
    color: #357ABD;
}

/* Submit button */
.sp-cf-submit-row {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
}

.sp-cf-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #4A90D9;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    min-width: 220px;
}

.sp-cf-submit-btn:hover {
    background: #357ABD;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.sp-cf-submit-btn:active {
    transform: scale(0.98);
}

.sp-cf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.sp-cf-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-cf-spin 0.6s linear infinite;
}

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

/* Messages */
.sp-cf-messages {
    margin-top: 5px;
}

.sp-cf-success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 18px 25px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    animation: sp-cf-fadeIn 0.4s ease;
}

.sp-cf-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 18px 25px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    animation: sp-cf-fadeIn 0.4s ease;
}

@keyframes sp-cf-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* reCAPTCHA notice */
.sp-cf-recaptcha-notice {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    line-height: 1.5;
}

.sp-cf-recaptcha-notice a {
    color: #999;
    text-decoration: underline;
}

.sp-cf-recaptcha-notice a:hover {
    color: #666;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .sp-cf-row-2col {
        grid-template-columns: 1fr;
    }

    .sp-cf-form input[type="text"],
    .sp-cf-form input[type="email"],
    .sp-cf-form input[type="tel"] {
        padding: 16px 24px;
        font-size: 15px;
    }

    .sp-cf-form textarea {
        padding: 16px 24px;
        font-size: 15px;
    }

    .sp-cf-submit-btn {
        width: 100%;
        padding: 16px 40px;
    }

    .sp-cf-submit-row {
        justify-content: center;
    }
}
