/**
 * RD Form Builder Styles
 * Modern ve responsive form tasarımı
 */

/* Form Wrapper */
.rd-form-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* Form Container */
.rd-form {
    width: 100%;
    padding: 0;
}

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

/* Form Field */
.rd-form-field {
    width: 100%;
}

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

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

/* Labels */
.rd-form label {
    display: block;
    color: #3c3c3c;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.rd-form label .required {
    color: #e74c3c;
    margin-left: 2px;
}

/* Input Fields */
.rd-form input[type="text"],
.rd-form input[type="email"],
.rd-form input[type="tel"],
.rd-form select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #3c3c3c;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.rd-form input[type="text"]:focus,
.rd-form input[type="email"]:focus,
.rd-form input[type="tel"]:focus,
.rd-form select:focus {
    outline: none;
    border-color: #3CC1DD;
    box-shadow: 0 0 0 3px rgba(60, 193, 221, 0.1);
}

.rd-form input.error,
.rd-form select.error {
    border-color: #e74c3c;
}

.rd-form input.error:focus,
.rd-form select.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Select Dropdown */
.rd-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233c3c3c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Checkbox Fields */
.rd-checkbox-field {
    margin-top: 10px;
}

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

.rd-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 10px 0 0;
    cursor: pointer;
    accent-color: #3CC1DD;
}

.rd-checkbox-label span {
    color: #3c3c3c;
}

.rd-checkbox-label a {
    color: #3CC1DD;
    text-decoration: underline;
}

.rd-checkbox-label a:hover {
    color: #2ba8c0;
}

/* Submit Button */
.rd-form-submit {
    width: 100%;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background-color: #3CC1DD;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rd-form-submit:hover {
    background-color: #2ba8c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 193, 221, 0.3);
}

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

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

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

.rd-form-submit.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: rd-spinner 0.6s linear infinite;
}

@keyframes rd-spinner {
    to { transform: rotate(360deg); }
}

/* Messages */
.rd-form-message {
    padding: 16px;
    margin-top: 20px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.6;
}

.rd-form-message.success {
    color: #27ae60;
    background-color: #eafaf1;
    border: 1px solid #27ae60;
}

.rd-form-message.error {
    color: #e74c3c;
    background-color: #fadbd8;
    border: 1px solid #e74c3c;
}

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

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

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

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

@media (max-width: 767px) {
    .rd-form input[type="text"],
    .rd-form input[type="email"],
    .rd-form input[type="tel"],
    .rd-form select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .rd-form label {
        color: #e0e0e0;
    }

    .rd-form input[type="text"],
    .rd-form input[type="email"],
    .rd-form input[type="tel"],
    .rd-form select {
        color: #e0e0e0;
        background-color: #2c3e50;
        border-color: #34495e;
    }

    .rd-checkbox-label span {
        color: #e0e0e0;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rd-form-message {
    animation: slideIn 0.3s ease-out;
}