/**
 * Form Styles
 * @package FizikTedavi
 */

/* ==========================================================================
   FORM BASE STYLES
   ========================================================================== */

.fiziktedavi-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.form-grid.two-columns {
    grid-template-columns: 1fr 1fr;
}

.form-grid.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Form Fields */
.form-field {
    position: relative;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-field label.required::after {
    content: ' *';
    color: #e74c3c;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.form-field select {
    cursor: pointer;
}

/* Input Icons */
.form-field.has-icon {
    position: relative;
}

.form-field.has-icon input {
    padding-left: 3rem;
}

.form-field .field-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
    z-index: 2;
}

/* Validation States */
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-field.has-success input,
.form-field.has-success select,
.form-field.has-success textarea {
    border-color: #27ae60;
    background-color: #f2fdf4;
}

.error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #e74c3c;
    font-weight: 500;
}

.success-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #27ae60;
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.form-actions .btn {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* KVKK Consent */
.kvkk-consent-field {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.kvkk-consent-field label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 500;
    margin-bottom: 0;
    cursor: pointer;
}

.kvkk-consent-field input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.kvkk-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.kvkk-link:hover {
    color: var(--secondary-color);
}

/* Form Alerts */
.form-alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.form-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Form Loader */
.form-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--border-radius);
}

.form-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.form-loader span {
    color: var(--text-dark);
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Date Picker Custom Styles */
.ui-datepicker {
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    font-family: inherit;
}

.ui-datepicker-header {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.ui-datepicker-title {
    color: var(--white);
    font-weight: 600;
}

.ui-datepicker td a {
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem;
    display: block;
    text-align: center;
}

.ui-datepicker td a:hover {
    background: var(--primary-color);
    color: var(--white);
}

.ui-datepicker td.ui-datepicker-today a {
    background: var(--light-gray);
    font-weight: 600;
}

.ui-datepicker td.ui-datepicker-current-day a {
    background: var(--primary-color);
    color: var(--white);
}

.ui-datepicker td.unavailable a {
    background: #f8d7da;
    color: #721c24;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Service Selection Cards */
.service-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.service-card {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    border-color: var(--primary-color);
    background: var(--light-gray);
}

.service-card.selected {
    border-color: var(--primary-color);
    background: rgba(46, 139, 87, 0.1);
}

.service-card input[type="radio"] {
    display: none;
}

.service-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.service-card .price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-card .duration {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.time-slot {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.time-slot:hover {
    border-color: var(--primary-color);
    background: var(--light-gray);
}

.time-slot.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

.time-slot.unavailable {
    background: #f8d7da;
    color: #721c24;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot input[type="radio"] {
    display: none;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .fiziktedavi-form {
        padding: 1.5rem;
        margin: 1rem;
    }

    .form-grid.two-columns,
    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }

    .service-selection {
        grid-template-columns: 1fr;
    }

    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .fiziktedavi-form {
        padding: 1rem;
    }

    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 0.875rem;
    }

    .form-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   CONTACT FORM 7 INTEGRATION
   ========================================================================== */

.wpcf7-form {
    padding: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.wpcf7-form-control-wrap {
    position: relative;
    display: block;
}

.wpcf7-form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.wpcf7-form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

.wpcf7-not-valid {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
}

.wpcf7-validation-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.wpcf7-mail-sent-ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.wpcf7-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 0.5rem;
}

/* Honeypot field (anti-spam) */
.wpcf7-form .screen-reader-response {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.form-help-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.required-note {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.form-buttons .btn-secondary {
    background: var(--light-gray);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.form-buttons .btn-secondary:hover {
    background: var(--border-color);
}