/* Canada Trade Finance Diagnostic Intake Form Styles
 * Complies with CTF-INTAKE-2.0.2 & WCAG 2.1 AA Contrast Standards
 * Aligned with Canada Trade Finance 2026 Brand Design System
 */

:root {
    --ctf-primary: #022158; /* Deep Prestige Navy */
    --ctf-primary-hover: #032e7a;
    --ctf-accent: #046bd2; /* Brand Blue */
    --ctf-bg-light: #F0F5FA; /* Brand Ice Tint */
    --ctf-text: #1e293b; /* Brand Slate Dark */
    --ctf-text-muted: #64748b; /* Brand Slate Medium */
    --ctf-border: #cbd5e1;
    --ctf-error: #dc2626;
    --ctf-error-bg: #fee2e2;
    --ctf-success: #059669;
    --ctf-success-bg: #d1fae5;
    --ctf-radius: 12px;
    --ctf-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ctf-form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 4px;
    background: transparent;
    font-family: var(--ctf-font);
    color: var(--ctf-text);
    box-sizing: border-box;
    line-height: 1.5;
}

.ctf-form-container *,
.ctf-form-container *::before,
.ctf-form-container *::after {
    box-sizing: border-box;
}

/* Header */
.ctf-form-header {
    margin-bottom: 24px;
    text-align: left;
}

.ctf-form-title {
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 800;
    color: var(--ctf-primary);
    margin: 0 0 10px 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.ctf-form-intro {
    font-size: 15.5px;
    color: var(--ctf-text);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.ctf-form-supporting {
    font-size: 13.5px;
    color: var(--ctf-text-muted);
    margin: 0;
    font-style: italic;
}

/* Progress Indicator */
.ctf-progress-bar {
    margin-bottom: 26px;
}

.ctf-step-indicators {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: #94a3b8;
    overflow-x: auto;
    white-space: nowrap;
    gap: 8px;
    scrollbar-width: none;
}

.ctf-step-indicators::-webkit-scrollbar {
    display: none;
}

.ctf-step-dot {
    transition: color 0.2s ease;
    cursor: default;
}

.ctf-step-dot.active {
    color: var(--ctf-primary);
    font-weight: 800;
}

.ctf-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.ctf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #022158, #046bd2);
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fieldsets / Steps */
.ctf-form-step {
    border: 1px solid #e2e8f0;
    border-radius: var(--ctf-radius);
    padding: clamp(16px, 3.5vw, 28px);
    margin: 0 0 20px 0;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(2, 33, 88, 0.04);
    display: none;
}

.ctf-form-step.active {
    display: block;
    animation: ctfStepFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ctfStepFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctf-step-legend {
    font-size: clamp(17px, 2.5vw, 20px);
    font-weight: 800;
    color: var(--ctf-primary);
    padding: 0 8px;
    margin-bottom: 16px;
    float: none;
    width: auto;
    letter-spacing: -0.01em;
}

.ctf-section-intro {
    font-size: 14.5px;
    color: var(--ctf-text-muted);
    margin: -5px 0 20px 0;
    line-height: 1.5;
}

/* Field Groups */
.ctf-field-group {
    margin-bottom: 18px;
}

.ctf-field-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ctf-text);
    margin-bottom: 6px;
}

.ctf-required {
    color: var(--ctf-error);
    margin-left: 2px;
}

.ctf-field-group input,
.ctf-field-group select,
.ctf-field-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ctf-text);
    background: #ffffff;
    border: 1.5px solid var(--ctf-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.ctf-field-group input:focus,
.ctf-field-group select:focus,
.ctf-field-group textarea:focus {
    border-color: var(--ctf-primary);
    box-shadow: 0 0 0 3px rgba(2, 33, 88, 0.15);
}

.ctf-field-error {
    border-color: var(--ctf-error) !important;
    background-color: #fff8f8 !important;
}

.ctf-field-help {
    font-size: 12.5px;
    color: var(--ctf-text-muted);
    margin: 6px 0 0 0;
}

/* Grid helper */
.ctf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .ctf-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Input Prefix ($) */
.ctf-input-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.ctf-input-prefix span {
    position: absolute;
    left: 14px;
    font-weight: 700;
    color: var(--ctf-text-muted);
    pointer-events: none;
}

.ctf-input-prefix input {
    padding-left: 32px !important;
}

/* Callout */
.ctf-callout-info {
    background: var(--ctf-bg-light);
    border-left: 4px solid var(--ctf-primary);
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.ctf-callout-info p {
    margin: 0;
    font-size: 13.5px;
    color: #0c2b5e;
    line-height: 1.5;
}

/* Radios and Checkboxes (Strictly Aligned) */
.ctf-radio-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 18px !important;
    margin-top: 8px !important;
}

.ctf-radio-group label {
    font-weight: 600 !important;
    font-size: 14.5px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    cursor: pointer !important;
    color: var(--ctf-text) !important;
    white-space: nowrap !important;
    margin: 0 !important;
    float: none !important;
}

.ctf-radio-group label input[type="radio"],
.ctf-radio-card input[type="radio"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 18px !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
    accent-color: var(--ctf-primary) !important;
    float: none !important;
    order: 1 !important;
    position: static !important;
}

.ctf-radio-group label span,
.ctf-radio-card span {
    order: 2 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.ctf-checkbox-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
    margin-top: 8px !important;
    width: 100% !important;
}

.ctf-checkbox-grid label,
.ctf-checkbox-card {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    border: 1.5px solid var(--ctf-border) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ctf-text) !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
    text-align: left !important;
}

.ctf-checkbox-grid label:hover,
.ctf-checkbox-card:hover {
    background: var(--ctf-bg-light) !important;
    border-color: var(--ctf-primary) !important;
}

.ctf-checkbox-grid label input[type="checkbox"],
.ctf-checkbox-card input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 18px !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
    accent-color: var(--ctf-primary) !important;
    float: none !important;
    order: 1 !important;
    position: static !important;
}

.ctf-checkbox-grid label span,
.ctf-checkbox-card span {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ctf-text) !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 2 !important;
    float: none !important;
}

.ctf-radio-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 8px !important;
    width: 100% !important;
}

.ctf-radio-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 13px 16px !important;
    border: 1.5px solid var(--ctf-border) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    text-align: left !important;
}

.ctf-radio-card:hover {
    background: var(--ctf-bg-light) !important;
    border-color: var(--ctf-primary) !important;
}

.ctf-radio-card span {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--ctf-text) !important;
    line-height: 1.4 !important;
    display: inline-block !important;
}

/* Enforce single line for 'Not Sure' everywhere */
.ctf-nowrap,
.ctf-radio-group label,
.ctf-checkbox-card span {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.ctf-checkbox-confirm {
    margin: 20px 0 10px 0;
    padding: 14px;
    background: var(--ctf-bg-light);
    border: 1.5px solid #dbeafe;
    border-radius: 8px;
}

.ctf-checkbox-confirm label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0c2b5e;
    cursor: pointer;
}

.ctf-consent-box {
    margin: 20px 0 12px 0;
    padding: 16px;
    background: var(--ctf-bg-light);
    border: 1.5px solid #dbeafe;
    border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ctf-consent-box.ctf-field-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.ctf-field-error-msg {
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 600;
    margin-top: 6px;
}

.ctf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ctf-text);
    cursor: pointer;
}

.ctf-submission-note {
    font-size: 12.5px;
    color: var(--ctf-text-muted);
    margin: 0 0 20px 0;
    font-style: italic;
}

.ctf-divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 24px 0;
}

/* Step Navigation Buttons */
.ctf-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
}

.ctf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.2;
}

.ctf-btn-back {
    background: var(--ctf-bg-light) !important;
    color: var(--ctf-text) !important;
    border: 1.5px solid var(--ctf-border) !important;
}

.ctf-btn-back:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.ctf-btn-next,
.ctf-btn-submit,
.ctf-btn-primary {
    background: var(--ctf-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 33, 88, 0.25);
}

.ctf-btn-next:hover,
.ctf-btn-submit:hover,
.ctf-btn-primary:hover {
    background: var(--ctf-primary-hover) !important;
    box-shadow: 0 6px 18px rgba(2, 33, 88, 0.35);
    transform: translateY(-1px);
}

.ctf-btn-checkout {
    font-size: 16px;
    padding: 14px 28px;
    background: #059669;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.ctf-btn-checkout:hover {
    background: #047857;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
}

/* Error Summary */
.ctf-error-summary {
    background: var(--ctf-error-bg);
    border: 1.5px solid #fca5a5;
    color: var(--ctf-error);
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.ctf-error-summary ul {
    margin: 0;
    padding-left: 20px;
}

/* Result Card */
.ctf-result-card {
    text-align: center;
    padding: 40px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--ctf-radius);
    box-shadow: 0 8px 25px rgba(2, 33, 88, 0.05);
}

.ctf-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: var(--ctf-success-bg);
    color: var(--ctf-success);
    border-radius: 50%;
    font-size: 32px;
    margin-bottom: 16px;
}

.ctf-result-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: var(--ctf-primary);
}

.ctf-result-ref {
    font-size: 15px;
    margin: 0 0 16px 0;
    color: var(--ctf-text-muted);
}

.ctf-result-ref strong {
    color: var(--ctf-primary);
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
}

.ctf-result-message {
    font-size: 15px;
    color: var(--ctf-text);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .ctf-form-container {
        padding: 4px 0;
    }
    .ctf-form-step {
        padding: 16px 12px;
    }
    .ctf-step-nav {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .ctf-step-nav .ctf-btn {
        width: 100%;
    }
    .ctf-step-indicators {
        font-size: 11.5px;
        gap: 6px;
    }
}

/* ==========================================================================
   Review Confirmation Page Styles
   ========================================================================== */
.ctf-confirmation-wrapper {
    max-width: 780px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: var(--ctf-font);
    box-sizing: border-box;
    color: var(--ctf-text);
}

.ctf-confirmation-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 44px 36px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.ctf-confirmation-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.ctf-confirmation-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctf-confirmation-title {
    font-size: 28px;
    font-weight: 800;
    color: #0c2b5e;
    margin: 0 0 10px 0;
    line-height: 1.25;
}

.ctf-confirmation-subtitle {
    font-size: 16px;
    color: #4b5563;
    max-width: 580px;
    margin: 0 auto 24px auto;
    line-height: 1.6;
}

.ctf-ref-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 18px;
    border-radius: 24px;
    margin-bottom: 30px;
    border: 1px solid #cbd5e1;
}

.ctf-ref-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.ctf-ref-badge {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--ctf-primary);
    letter-spacing: 0.5px;
}

/* Summary Box */
.ctf-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    text-align: left;
    margin-bottom: 32px;
}

.ctf-summary-heading {
    font-size: 17px;
    font-weight: 700;
    color: #0c2b5e;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ctf-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ctf-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ctf-summary-label {
    font-size: 12.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ctf-summary-val {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.ctf-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    width: fit-content;
}

.ctf-status-in-review {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Timeline */
.ctf-timeline-section {
    text-align: left;
    margin-bottom: 32px;
}

.ctf-timeline-title {
    font-size: 19px;
    font-weight: 700;
    color: #0c2b5e;
    margin: 0 0 20px 0;
}

.ctf-timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.ctf-timeline-steps::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.ctf-timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    position: relative;
    z-index: 2;
}

.ctf-timeline-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ctf-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 90, 156, 0.25);
}

.ctf-timeline-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0c2b5e;
    margin: 0 0 6px 0;
}

.ctf-timeline-body p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.55;
    margin: 0;
}

/* Footer Notice */
.ctf-confirmation-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 28px;
}

.ctf-footer-shield-icon {
    color: #005a9c;
    flex-shrink: 0;
    margin-top: 2px;
}

.ctf-confirmation-footer-note a {
    color: var(--ctf-primary);
    text-decoration: underline;
}

.ctf-confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Download Card */
.ctf-report-download-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.08);
    text-align: left;
}

.ctf-report-download-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ctf-pdf-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ctf-download-text-wrap {
    flex: 1;
}

.ctf-download-title {
    font-size: 19px;
    font-weight: 800;
    color: #14532d;
    margin: 0 0 6px 0;
}

.ctf-download-subtitle {
    font-size: 14px;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

.ctf-download-btn-wrap {
    display: flex;
}

.ctf-btn-download {
    background: #16a34a !important;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    transition: all 0.2s ease;
}

.ctf-btn-download:hover {
    background: #15803d !important;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

.ctf-status-delivered {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

@media (max-width: 640px) {
    .ctf-confirmation-card {
        padding: 28px 18px;
    }
    .ctf-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .ctf-confirmation-title {
        font-size: 22px;
    }
    .ctf-report-download-info {
        flex-direction: column;
        gap: 12px;
    }
    .ctf-btn-download {
        width: 100%;
    }
}
