/* Talytica Form Styles */
/* Builds on existing OceanWP theme styles */

.talytica-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.talytica-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.talytica-form-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.talytica-form-header p {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

.talytica-form {
    width: 100%;
}

.talytica-form-group {
    margin-bottom: 20px;
}

.talytica-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.talytica-form-group label.required::after {
    content: " *";
    color: #e74c3c;
}

.talytica-form-group input[type="text"],
.talytica-form-group input[type="email"],
.talytica-form-group input[type="tel"],
.talytica-form-group textarea,
.talytica-form-group select {
    width: 100%;
    min-height: 45px;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.talytica-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.talytica-form-group input:focus,
.talytica-form-group textarea:focus,
.talytica-form-group select:focus {
    outline: none;
    border-color: #13aff0;
    box-shadow: 0 0 0 3px rgba(19, 175, 240, 0.1);
}

.talytica-form-group.has-error input,
.talytica-form-group.has-error textarea,
.talytica-form-group.has-error select {
    border-color: #e74c3c;
}

.talytica-form-group.has-error .error-message {
    display: block;
}

.error-message {
    display: none;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

.talytica-form-submit {
    text-align: center;
    margin-top: 30px;
}

.talytica-form-submit button {
    background-color: #13aff0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.talytica-form-submit button:hover {
    background-color: #0f96d1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 175, 240, 0.3);
}

.talytica-form-submit button:active {
    transform: translateY(0);
}

.talytica-form-submit button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.talytica-form-submit .loading {
    display: none;
    margin-left: 10px;
}

.talytica-form-submit.is-loading .loading {
    display: inline-block;
}

.talytica-form-submit.is-loading button {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success/Error Messages */
.form-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.form-message.show {
    display: block;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progressive Enhancement */
.talytica-form:not(.js-enabled) .form-message {
    /* Show fallback message for non-JS users */
    display: block;
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

.talytica-form:not(.js-enabled) .form-message::before {
    content: "JavaScript is disabled. Form submission will redirect to a new page.";
}

.talytica-form.js-enabled .form-message {
    /* Hide fallback message when JS is enabled */
    display: none;
}

.talytica-form.js-enabled .form-message.show {
    /* Show dynamic messages when JS is enabled */
    display: block;
}

/* Focus states for better accessibility */
.talytica-form-group input:focus,
.talytica-form-group textarea:focus,
.talytica-form-group select:focus {
    outline: 2px solid #13aff0;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .talytica-form-group input,
    .talytica-form-group textarea,
    .talytica-form-group select {
        border-width: 3px;
    }
    
    .talytica-form-submit button {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .talytica-form-group input,
    .talytica-form-group textarea,
    .talytica-form-group select,
    .talytica-form-submit button {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    .talytica-form-container {
        margin: 20px;
        padding: 20px;
    }
    
    .talytica-form-header h1 {
        font-size: 24px;
    }
    
    .talytica-form-submit button {
        width: 100%;
        padding: 15px 20px;
    }
}

@media only screen and (max-width: 480px) {
    .talytica-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .talytica-form-header h1 {
        font-size: 22px;
    }
}