/**
 * RD Form Builder CSS
 * Modern, responsive form stilleri
 */

/* Form Wrapper */
.rd-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Grid */
.rd-form-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.rd-form-field.rd-half {
    grid-column: span 1;
}

.rd-form-field.rd-full {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .rd-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rd-form-field.rd-half {
        grid-column: span 1;
    }

    .rd-form-field.rd-full {
        grid-column: span 2;
    }
}

/* Form Fields */
.rd-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.rd-form-field .required {
    color: #dc3545;
    font-weight: bold;
}

.rd-form-field input[type="text"],
.rd-form-field input[type="email"],
.rd-form-field input[type="tel"],
.rd-form-field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Select için özel ok ikonu */
.rd-form-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.rd-form-field input:focus,
.rd-form-field select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.rd-form-field input.error,
.rd-form-field select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Checkbox Fields */
.rd-checkbox-field {
    display: flex;
    align-items: flex-start;
}

.rd-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
}

.rd-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.rd-checkbox-label a {
    color: #4CAF50;
    text-decoration: none;
}

.rd-checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.rd-form-submit {
    width: 100%;
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rd-form-submit:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

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

.rd-form-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.rd-form-submit.loading {
    position: relative;
    color: transparent;
}

.rd-form-submit.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error Messages */
.rd-field-error {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

/* Form Messages */
.rd-form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
}

.rd-form-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.rd-form-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading State */
.rd-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 767px) {
    .rd-form-wrapper {
        padding: 15px;
    }

    .rd-form-grid {
        gap: 15px;
    }

    .rd-form-field input,
    .rd-form-field select {
        font-size: 16px; /* iOS zoom'u önlemek için */
    }
}
