/**
 * Form2PDF Generator - Frontend Stylesheet
 * Accessible, Modern, Responsive
 */

.f2p-form-container {
    max-width: 680px;
    margin: 24px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1a202c;
    box-sizing: border-box;
}

.f2p-form-header {
    margin-bottom: 24px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 16px;
}

.f2p-form-header h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.3;
}

.f2p-form-header p {
    margin: 0;
    font-size: 14px;
    color: #718096;
}

/* Feedback Messages */
.f2p-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
    align-items: center;
    gap: 12px;
}

.f2p-alert-visible {
    display: flex !important;
}

.f2p-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.f2p-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Form Fields */
.f2p-field-group {
    margin-bottom: 20px;
}

.f2p-field-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.f2p-field-group .f2p-required-star {
    color: #dc2626;
    margin-left: 2px;
}

.f2p-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.f2p-control:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.f2p-control.f2p-invalid {
    border-color: #dc2626;
    background-color: #fffbfb;
}

.f2p-field-error {
    margin-top: 4px;
    font-size: 12px;
    color: #dc2626;
    display: none;
}

.f2p-field-error.f2p-visible {
    display: block;
}

textarea.f2p-control {
    min-height: 110px;
    resize: vertical;
}

/* Submit Action */
.f2p-submit-wrapper {
    margin-top: 28px;
}

.f2p-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.f2p-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.f2p-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.f2p-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: f2p-spin 0.8s linear infinite;
}

.f2p-submitting .f2p-spinner {
    display: inline-block;
}

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

@media (max-width: 600px) {
    .f2p-form-container {
        padding: 22px 18px;
        margin: 16px 8px;
    }
}
