/* ===== SOLICITAÇÃO ANATOMOPATOLÓGICO – FORMULÁRIO INTERATIVO ===== */

/* ---------- Page Layout ---------- */
.form-page-wrapper {
    background-color: #f0f2f5;
    min-height: 100vh;
}

.form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ---------- Form Card ---------- */
.form-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.form-card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--titleFeaturedColor, #286b4e);
}

.form-card-header h2 {
    font-size: 1.6rem;
    color: var(--titleAndNavColor, #2c2d3f);
    margin-bottom: 0.25rem;
}

.form-card-header p {
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}

/* ---------- Form Sections ---------- */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--titleFeaturedColor, #286b4e);
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--titleFeaturedColor, #286b4e);
    font-family: var(--poppins, "Poppins", sans-serif);
}

/* ---------- Required indicators ---------- */
.required-star {
    color: #dc3545;
    font-weight: 700;
}

.label-hint {
    font-weight: 400;
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

/* ---------- Form Fields ---------- */
.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    font-family: var(--poppins, "Poppins", sans-serif);
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.3rem;
    display: block;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="date"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-size: 0.9rem;
    color: #495057;
    background-color: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--titleFeaturedColor, #286b4e);
    box-shadow: 0 0 0 3px rgba(40, 107, 78, 0.12);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* ---------- Inline Field Groups ---------- */
.form-row-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row-inline .form-field {
    flex: 1;
    min-width: 180px;
}

/* ---------- Checkboxes ---------- */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem 1.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-size: 0.88rem;
    color: #495057;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--titleFeaturedColor, #286b4e);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-item-other {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item-other input[type="text"] {
    flex: 1;
    padding: 0.35rem 0.65rem;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ---------- Radio Buttons ---------- */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-size: 0.88rem;
    color: #495057;
    cursor: pointer;
}

.radio-item input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--titleFeaturedColor, #286b4e);
    cursor: pointer;
}

/* ---------- Canvas (Silhueta) ---------- */
.canvas-wrapper {
    text-align: center;
    margin-top: 0.75rem;
}

#canvasSilhueta {
    border: 2px solid #ced4da;
    border-radius: 8px;
    cursor: crosshair;
    background-color: #fafafa;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.canvas-controls {
    margin-top: 0.75rem;
    text-align: center;
}

.btn-limpar {
    padding: 0.5rem 1.5rem;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-limpar:hover {
    background-color: #c82333;
}

.canvas-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
}

/* ---------- PDF Button ---------- */
.btn-gerar-pdf {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--titleFeaturedColor, #286b4e), #1e5038);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(40, 107, 78, 0.3);
    letter-spacing: 0.5px;
}

.btn-gerar-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 107, 78, 0.4);
}

.btn-gerar-pdf:active {
    transform: translateY(0);
}

.btn-gerar-pdf i {
    margin-right: 0.5rem;
}

.btn-gerar-pdf.btn-inactive {
    background: #adb5bd;
    box-shadow: none;
    opacity: 0.7;
}

.btn-gerar-pdf.btn-inactive:hover {
    transform: none;
    box-shadow: none;
}

/* ---------- Footer Info ---------- */
.form-footer-info {
    text-align: center;
    padding: 1.5rem 0 0;
    border-top: 2px solid #e9ecef;
    margin-top: 1.5rem;
}

.form-footer-info p {
    font-size: 0.82rem;
    color: #888;
    margin: 0.15rem 0;
}

.form-footer-info .footer-brand {
    font-weight: 700;
    color: var(--titleFeaturedColor, #286b4e);
    font-size: 0.95rem;
}

/* ---------- Signature Area ---------- */
.signature-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.signature-block {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.signature-block .signature-line {
    border-top: 1.5px solid #495057;
    margin-bottom: 0.3rem;
    width: 100%;
}

.signature-block p {
    font-size: 0.82rem;
    color: #495057;
    margin: 0;
}

/* ---------- Loading overlay ---------- */
.pdf-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.pdf-loading-overlay.active {
    display: flex;
}

.pdf-loading-box {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pdf-loading-box .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: var(--titleFeaturedColor, #286b4e);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

.pdf-loading-box p {
    margin: 0;
    font-family: var(--poppins, "Poppins", sans-serif);
    font-weight: 600;
    color: #495057;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem 1rem;
    }

    .form-container {
        padding: 1rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .form-row-inline {
        flex-direction: column;
        gap: 0;
    }

    .signature-area {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---------- Validation Toast ---------- */
.validation-toast {
    position: fixed;
    top: 20px;
    right: -420px;
    width: 380px;
    max-width: 90vw;
    background: #fff;
    border-left: 5px solid #dc3545;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 1.2rem 1.5rem;
    z-index: 10000;
    transition: right 0.4s ease;
    font-family: var(--poppins, "Poppins", sans-serif);
}

.validation-toast.show {
    right: 20px;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #dc3545;
    margin-bottom: 0.6rem;
}

.toast-title i {
    margin-right: 0.4rem;
}

.toast-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.toast-list li {
    font-size: 0.85rem;
    color: #495057;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.toast-list li:last-child {
    border-bottom: none;
}

.toast-list li::before {
    content: "• ";
    color: #dc3545;
    font-weight: 700;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.toast-close:hover {
    color: #dc3545;
}

/* ---------- Invalid Field Highlight ---------- */
.field-invalid {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12) !important;
}