/* ASME Readiness Assessment + Result page styles. Namespaced with "ra-"
   (readiness assessment) so nothing here collides with the existing
   homepage's Bootstrap/Tailwind classes. Mobile-first; all tap targets are
   at least 44px tall. */

.ra-page {
    background: #f8f9fc;
    min-height: 100vh;
    padding: 96px 16px 64px;
}

.dark .ra-page {
    background: #111827;
}

.ra-shell {
    max-width: 720px;
    margin: 0 auto;
}

.ra-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.ra-intro h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.ra-intro p {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 640px;
    margin: 0 auto;
}

.dark .ra-intro p {
    color: #9ca3af;
}

.ra-disclaimer {
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 1rem;
}

.ra-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.08);
    padding: 1.75rem 1.5rem;
}

.dark .ra-card {
    background: #1f2937;
}

.ra-progress-wrap {
    margin-bottom: 1.5rem;
}

.ra-progress-track {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.dark .ra-progress-track {
    background: #374151;
}

.ra-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #5D5CDE 0%, #667eea 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.ra-progress-label {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    text-align: right;
}

.ra-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ra-step-question {
    font-size: 1.05rem;
    color: #374151;
    margin-bottom: 1rem;
}

.dark .ra-step-question {
    color: #d1d5db;
}

.ra-step-note {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.ra-field {
    margin-bottom: 1.25rem;
}

.ra-field-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.ra-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ra-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    min-height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dark .ra-option {
    border-color: #374151;
}

.ra-option:hover {
    border-color: #5D5CDE;
}

.ra-option input {
    width: 20px;
    height: 20px;
    accent-color: #5D5CDE;
    flex-shrink: 0;
}

.ra-select,
.ra-text-input {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
}

.dark .ra-select,
.dark .ra-text-input {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.ra-group-row {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #e5e7eb;
}

.dark .ra-group-row {
    border-color: #374151;
}

.ra-group-row:last-child {
    border-bottom: none;
}

.ra-group-row-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ra-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.ra-btn {
    min-height: 48px;
    padding: 0 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.ra-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ra-btn-primary {
    background: #5D5CDE;
    color: #fff;
    margin-left: auto;
}

.ra-btn-primary:hover:not(:disabled) {
    background: #4a49b8;
}

.ra-btn-secondary {
    background: transparent;
    color: #5D5CDE;
    border: 1px solid #5D5CDE;
}

/* --- Result page --- */

.ra-result-score {
    text-align: center;
    padding: 1.5rem 0;
}

.ra-result-score .ra-score-number {
    font-size: 4rem;
    font-weight: 800;
    color: #5D5CDE;
    line-height: 1;
}

.ra-result-score .ra-score-band {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.ra-domain-bars {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 1.5rem 0;
}

.ra-domain-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ra-domain-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.ra-domain-bar-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.dark .ra-domain-bar-track {
    background: #374151;
}

.ra-domain-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #5D5CDE 0%, #667eea 100%);
}

.ra-domain-bar-na {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.ra-gap-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.ra-gap-list li {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-left: 3px solid #5D5CDE;
    border-radius: 6px;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.dark .ra-gap-list li {
    background: #111827;
}

.ra-service-recs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (min-width: 640px) {
    .ra-service-recs {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ra-service-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem;
}

.dark .ra-service-card {
    border-color: #374151;
}

.ra-service-card .ra-service-tier {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5D5CDE;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.ra-service-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.ra-service-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.dark .ra-service-card p {
    color: #9ca3af;
}

.ra-gate-overlay {
    position: relative;
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.ra-gate-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.dark .ra-gate-form {
    background: #1f2937;
    border-color: #374151;
}

.ra-gate-form h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ra-gate-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    margin-top: 0.9rem;
}

.ra-gate-form input {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
}

.dark .ra-gate-form input {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.ra-honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- V0.2 Order System (namespaced "order-", appended - does not modify
   any rule above) --- */

.order-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.order-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #e5e7eb;
    color: #111827;
}

.dark .order-badge { background: #374151; color: #f3f4f6; }

.order-badge-paid, .order-badge-completed { background: #dcfce7; color: #166534; }
.order-badge-need_more_information, .order-badge-failed { background: #fee2e2; color: #991b1b; }
.order-badge-under_review, .order-badge-documents_submitted, .order-badge-report_preparing { background: #dbeafe; color: #1e40af; }
.order-badge-awaiting_documents, .order-badge-awaiting_payment, .order-badge-pending { background: #fef3c7; color: #92400e; }

.order-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dark .order-dropzone { border-color: #4b5563; }

.order-dropzone.order-dropzone-active {
    border-color: #5D5CDE;
    background: rgba(93, 92, 222, 0.06);
}

.order-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.order-doc-table th, .order-doc-table td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .order-doc-table th, .dark .order-doc-table td { border-color: #374151; }

.order-requirement-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.dark .order-requirement-row { border-color: #374151; }

.order-requirement-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-requirement-options label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.order-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-timeline-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    border-left: 2px solid #e5e7eb;
    font-size: 0.9rem;
}

.dark .order-timeline-list li { border-color: #374151; }

.order-timeline-list li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0.9rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5D5CDE;
}

.order-note-banner {
    background: #fef3c7;
    border-left: 4px solid #d97706;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.dark .order-note-banner { background: #451a03; color: #fde68a; }

.report-section { margin-bottom: 1.5rem; }
.report-finding { border-left: 4px solid #9ca3af; padding: 0.75rem 1rem; margin-bottom: 1rem; background: #f9fafb; border-radius: 6px; }
.dark .report-finding { background: #111827; }
.report-finding-priority_1 { border-color: #dc2626; }
.report-finding-priority_2 { border-color: #f97316; }
.report-finding-priority_3 { border-color: #eab308; }
.report-finding-observation { border-color: #3b82f6; }
.report-finding-information_required { border-color: #6b7280; }
.report-finding-meta { font-size: 0.85rem; color: #6b7280; }
.report-summary-counts { list-style: none; padding: 0; }
.report-summary-counts li { padding: 0.25rem 0; }
.report-disclaimer { font-size: 0.8rem; color: #9ca3af; border-top: 1px solid #e5e7eb; padding-top: 1rem; margin-top: 1.5rem; }
.dark .report-disclaimer { border-color: #374151; }
.report-cta { display: inline-block; margin-top: 0.5rem; padding: 0.6rem 1.2rem; background: #5D5CDE; color: #fff; border-radius: 8px; font-weight: 700; text-decoration: none; }

@media print {
    .navbar, footer, .order-actions-noprint { display: none !important; }
    .ra-page { padding: 0; background: #fff; }
    body { color: #000; background: #fff; }
}
