/* Terra Firma Contact Form Styles */
.tf-contact-form-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    background: #2d2d2d;
    border-radius: 16px;
    color: #fff;
}

.tf-contact-form-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    text-align: left;
}

.tf-contact-form {
    width: 100%;
}

.tf-form-group {
    margin-bottom: 20px;
}

.tf-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

.tf-required {
    color: #00d4aa;
    font-weight: bold;
}

.tf-form-input,
.tf-form-textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tf-form-input::placeholder,
.tf-form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tf-form-input:focus,
.tf-form-textarea:focus {
    outline: none;
    border-color: #00d4aa;
    background: rgba(255, 255, 255, 0.15);
}

/* Only show invalid styles after user interaction */
.tf-form-input.user-interacted:invalid,
.tf-form-textarea.user-interacted:invalid {
    border-color: #ff6b6b;
}

.tf-form-input.user-interacted:invalid:focus,
.tf-form-textarea.user-interacted:invalid:focus {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Client-side validation states */
.tf-form-input.tf-error,
.tf-form-textarea.tf-error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    animation: shake 0.3s ease-in-out;
}

.tf-form-input.tf-error:focus,
.tf-form-textarea.tf-error:focus {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.tf-form-input.tf-valid,
.tf-form-textarea.tf-valid {
    border-color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.tf-form-input.tf-valid:focus,
.tf-form-textarea.tf-valid:focus {
    border-color: #00d4aa;
    background: rgba(0, 212, 170, 0.15);
}

/* Shake animation for validation errors */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.tf-form-textarea {
    resize: vertical;
    min-height: 120px;
    border-radius: 8px;
}

.tf-help-text {
    margin-top: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.tf-error-message {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #ff6b6b;
    font-weight: 500;
    min-height: 1.2rem;
    line-height: 1.4;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    padding: 8px;
}

.tf-form-actions {
    margin-top: 30px;
    text-align: center;
}

.tf-form-submit {
    padding: 15px 30px;
    background-color: #00d4aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.tf-form-submit:hover {
    background-color: #00c199;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.tf-form-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.3);
}

.tf-form-submit:active {
    transform: translateY(0);
}

.tf-form-submit:disabled {
    background-color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .tf-contact-form-container {
        border: 2px solid #fff;
    }

    .tf-form-input,
    .tf-form-textarea {
        border: 2px solid #fff;
    }

    .tf-form-submit {
        border: 2px solid #00d4aa;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tf-form-input,
    .tf-form-textarea,
    .tf-form-submit {
        transition: none;
    }

    .tf-form-input.tf-error,
    .tf-form-textarea.tf-error {
        animation: none;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .tf-contact-form-container {
        padding: 30px;
        margin: 1rem;
        border-radius: 12px;
    }

    .tf-contact-form-title {
        font-size: 24px;
        margin-bottom: 15px;
        text-align: center;
    }

    .tf-form-group {
        margin-bottom: 20px;
    }

    .tf-form-input,
    .tf-form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
    }

    .tf-form-submit {
        width: 100%;
        padding: 15px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .tf-contact-form-container {
        padding: 20px;
        margin: 0.5rem;
        border-radius: 8px;
    }

    .tf-contact-form-title {
        font-size: 20px;
    }
}

/* Success and error messages */
.tf-success-message {
    display: none;
    padding: 15px;
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid #00d4aa;
    border-radius: 8px;
    color: #00d4aa;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.tf-form-error-message {
    display: none;
    padding: 15px;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    color: #ff6b6b;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

/* Print styles */
@media print {
    .tf-contact-form-container {
        background: #fff;
        color: #000;
        border: 1px solid #000000;
    }

    .tf-form-input,
    .tf-form-textarea {
        background: #fff;
        color: #000;
        border: 1px solid #000;
    }

    .tf-form-submit {
        display: none;
    }

    .tf-success-message,
    .tf-form-error-message {
        display: none;
    }
}

/* New Clean Form States and Feedback Styles */

/* Form status messages */
.tf-form-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.tf-form-status-success {
    background-color: rgba(0, 212, 170, 0.15);
    border-color: #00d4aa;
    color: #00d4aa;
}

.tf-form-status-error {
    background-color: rgba(255, 107, 107, 0.15);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* Field error states */
.tf-field-error {
    border-color: #ff6b6b !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
}

.tf-field-error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Form loading state */
.tf-form-loading {
    position: relative;
}

.tf-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(45, 45, 45, 0.7);
    border-radius: 16px;
    z-index: 10;
    pointer-events: none;
}

.tf-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(0, 212, 170, 0.3);
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: tf-spin 1s linear infinite;
    z-index: 11;
    pointer-events: none;
}

@keyframes tf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button states */
.tf-btn-loading {
    position: relative;
    color: transparent !important;
    font-size: 14px !important;
}

.tf-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
}

.tf-btn-success {
    background-color: #00d4aa !important;
    border-color: #00d4aa !important;
    font-size: 14px !important;
}

.tf-btn-error {
    background-color: #ff6b6b !important;
    border-color: #ff6b6b !important;
    font-size: 14px !important;
}
