/* Dynamic Form Pro - Frontend Styles (Based on Reference Design) */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Form Container */
.dfp-form-wrap {
    max-width: 900px;
    margin: 40px auto;
    background: #fafbfc;
    padding: 50px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Form */
.dfp-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Form Header */
.dfp-header {
    text-align: center;
    margin-bottom: 30px;
}

.dfp-title {
    font-size: 24px;
    font-weight: 700;
    color: #334155;
    /* Slate 700 */
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.dfp-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #9f6b6b;
    /* Muted reddish brown */
    margin: 0;
}

/* Form Fields */
.dfp-form .dfp-field {
    margin-bottom: 0;
}

/* Full width fields (textarea, submit) */
.dfp-form .dfp-type-textarea,
.dfp-form .dfp-actions {
    grid-column: 1 / -1;
}

/* Labels */
.dfp-form label {
    display: block;
    font-weight: 600;
    font-size: 18px;
    color: #000000;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.dfp-form .dfp-required {
    color: #ff0000;
    margin-left: 4px;
    font-weight: 700;
}

/* Input Fields */
.dfp-form input[type=text],
.dfp-form input[type=email],
.dfp-form input[type=tel],
.dfp-form textarea,
.dfp-form select {
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    color: #6c757d;
    background: #f8fafc;
    /* Light greyish background */
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dfp-form input[type=text]:focus,
.dfp-form input[type=email]:focus,
.dfp-form input[type=tel]:focus,
.dfp-form textarea:focus,
.dfp-form select:focus {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

/* Placeholder Styling */
.dfp-form input::placeholder,
.dfp-form textarea::placeholder {
    color: #6b7280;
    opacity: 1;
    font-weight: 400;
}

/* Helper Text Below Input */
.dfp-form .dfp-field::after {
    content: attr(data-helper);
    display: block;
    font-size: 14px;
    color: #adb5bd;
    margin-top: 8px;
    font-weight: 400;
}

/* Suggestion/Description Text */
.dfp-description {
    font-size: 14px;
    color: #9ca3af;
    /* Light gray */
    margin-top: 6px;
    font-weight: 400;
    line-height: 1.4;
}

/* Textarea */
.dfp-form textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

/* Select Dropdown */
.dfp-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23adb5bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 45px;
}

/* Checkbox Group */
.dfp-form .dfp-type-checkbox label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dfp-form .dfp-type-checkbox label:hover {
    color: #4361ee;
}

.dfp-form .dfp-type-checkbox input[type=checkbox] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4361ee;
}

/* Submit Button */
.dfp-form .dfp-actions {
    margin-top: 20px;
    text-align: center;
}

.dfp-form .dfp-submit {
    background: #4361ee;
    color: #ffffff;
    padding: 18px 60px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
    letter-spacing: -0.01em;
    min-width: 200px;
}

.dfp-form .dfp-submit:hover {
    background: #3651d4;
    box-shadow: 0 12px 28px rgba(67, 97, 238, 0.4);
    transform: translateY(-2px);
}

.dfp-form .dfp-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.dfp-form .dfp-submit:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Loading State */
.dfp-form.dfp-loading .dfp-submit {
    position: relative;
    color: transparent;
}

.dfp-form.dfp-loading .dfp-submit::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Messages */
.dfp-form .dfp-messages {
    margin-top: 20px;
    grid-column: 1 / -1;
}

.dfp-form .dfp-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    animation: shake 0.3s ease;
}

.dfp-form .dfp-error::before {
    content: '⚠';
    margin-right: 6px;
    font-size: 14px;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.dfp-form .dfp-success {
    background: #d1f4e0;
    border: 2px solid #28a745;
    color: #155724;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: slideDown 0.4s ease;
}

.dfp-form .dfp-success::before {
    content: '✓';
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Field Error State */
.dfp-form input.error,
.dfp-form textarea.error,
.dfp-form select.error {
    border: 2px solid #dc3545;
    background: #fff5f5;
}

.dfp-form input.error:focus,
.dfp-form textarea.error:focus,
.dfp-form select.error:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* Responsive Design - Tablet */
@media (max-width: 992px) {
    .dfp-form-wrap {
        max-width: 700px;
        padding: 40px 30px;
        margin: 30px auto;
    }

    .dfp-form {
        gap: 25px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .dfp-form-wrap {
        margin: 20px;
        padding: 30px 20px;
    }

    .dfp-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dfp-form .dfp-field {
        grid-column: 1;
    }

    .dfp-form label {
        font-size: 16px;
    }

    .dfp-form input[type=text],
    .dfp-form input[type=email],
    .dfp-form input[type=tel],
    .dfp-form textarea,
    .dfp-form select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 16px 18px;
    }

    .dfp-form textarea {
        min-height: 150px;
    }

    .dfp-form .dfp-submit {
        width: 100%;
        padding: 16px 40px;
        font-size: 16px;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    .dfp-form-wrap {
        margin: 15px;
        padding: 25px 15px;
    }

    .dfp-form {
        gap: 18px;
    }

    .dfp-form label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .dfp-form input[type=text],
    .dfp-form input[type=email],
    .dfp-form input[type=tel],
    .dfp-form textarea,
    .dfp-form select {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .dfp-form .dfp-submit {
        padding: 14px 30px;
        border-radius: 40px;
    }
}

/* iPad Specific */
@media (min-width: 768px) and (max-width: 1024px) {
    .dfp-form-wrap {
        max-width: 750px;
        padding: 45px 35px;
    }

    .dfp-form {
        gap: 28px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .dfp-form-wrap {
        max-width: 1000px;
        padding: 60px;
    }

    .dfp-form {
        gap: 35px;
    }
}

/* Accessibility */
.dfp-form *:focus-visible {
    outline: 3px solid #4361ee;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .dfp-form-wrap {
        box-shadow: none;
        border: 1px solid #000;
    }

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

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .dfp-form-wrap {
        background: #1a1a1a;
    }

    .dfp-form label {
        color: #ffffff;
    }

    .dfp-form input[type=text],
    .dfp-form input[type=email],
    .dfp-form input[type=tel],
    .dfp-form textarea,
    .dfp-form select {
        background: #2d2d2d;
        color: #ffffff;
    }

    .dfp-form input::placeholder,
    .dfp-form textarea::placeholder {
        color: #6c757d;
    }
}

/* Helper text for specific fields */
.dfp-field-helper {
    font-size: 14px;
    color: #adb5bd;
    margin-top: 8px;
    display: block;
}