/* Canada Trade Finance Intake Form Styles */

:root {
    --ctf-primary: #0066cc;
    --ctf-primary-light: #e6f0ff;
    --ctf-text-dark: #1a1a1a;
    --ctf-text-light: #666666;
    --ctf-border: #e0e0e0;
    --ctf-success: #009900;
    --ctf-error: #cc0000;
    --ctf-spacing-xs: 4px;
    --ctf-spacing-sm: 8px;
    --ctf-spacing-md: 16px;
    --ctf-spacing-lg: 24px;
    --ctf-spacing-xl: 32px;
}

.ctf-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ctf-text-dark);
    line-height: 1.6;
}

/* Header */
.ctf-form-header {
    margin-bottom: var(--ctf-spacing-xl);
    padding-bottom: var(--ctf-spacing-lg);
    border-bottom: 2px solid var(--ctf-border);
}

.ctf-form-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 var(--ctf-spacing-md) 0;
    color: var(--ctf-text-dark);
    letter-spacing: -0.5px;
}

.ctf-form-description {
    font-size: 16px;
    color: var(--ctf-text-light);
    margin: 0 0 var(--ctf-spacing-sm) 0;
}

.ctf-form-note {
    font-size: 14px;
    color: #999999;
    font-style: italic;
    margin: 0;
}

/* Form Sections */
.ctf-form {
    display: flex;
    flex-direction: column;
    gap: var(--ctf-spacing-xl);
}

.ctf-section {
    padding: var(--ctf-spacing-lg);
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid var(--ctf-border);
}

.ctf-section:last-of-type:not(.ctf-submit-area) {
    margin-bottom: 0;
}

.ctf-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 var(--ctf-spacing-md) 0;
    padding-bottom: var(--ctf-spacing-md);
    border-bottom: 2px solid var(--ctf-primary);
    color: var(--ctf-text-dark);
}

.ctf-section-intro {
    font-size: 14px;
    color: var(--ctf-text-light);
    margin: 0 0 var(--ctf-spacing-lg) 0;
    font-style: italic;
}

/* Form Fields */
.ctf-field-group {
    margin-bottom: var(--ctf-spacing-lg);
}

.ctf-field-group:last-child {
    margin-bottom: 0;
}

.ctf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--ctf-spacing-sm);
    color: #000000;
}

.ctf-required {
    color: var(--ctf-error);
}

.ctf-optional {
    color: var(--ctf-text-light);
    font-weight: 400;
    font-size: 12px;
}

.ctf-helper-text {
    font-size: 12px;
    color: var(--ctf-text-light);
    margin: var(--ctf-spacing-xs) 0 var(--ctf-spacing-sm) 0;
    font-style: italic;
}

/* Input Fields */
.ctf-input,
.ctf-select {
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    line-height: 56px !important;
    border: 2px solid #cccccc !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    display: block;
}

.ctf-input:focus,
.ctf-select:focus {
    outline: none !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

.ctf-input::placeholder {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    opacity: 1 !important;
}

/* Ensure option text is always readable */
.ctf-select option {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    line-height: normal;
    padding: 8px;
}

.ctf-select {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px !important;
    padding-right: 44px !important;
}

/* Consent Checkbox */
.ctf-consent {
    background: #f0f4f8;
    padding: var(--ctf-spacing-md);
    border-left: 4px solid var(--ctf-primary);
    border-radius: 4px;
    margin-top: var(--ctf-spacing-lg);
}

.ctf-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    color: var(--ctf-text-dark);
    line-height: 1.5;
}

.ctf-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: var(--ctf-spacing-md);
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--ctf-primary);
    flex-shrink: 0;
}

.ctf-radio-group label,
.ctf-checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: #000000;
}

.ctf-radio-group input[type="radio"],
.ctf-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: var(--ctf-spacing-md);
    cursor: pointer;
    accent-color: var(--ctf-primary);
}

/* Yes/No Fields */
.ctf-yes-no .ctf-radio-group {
    flex-direction: row;
    gap: var(--ctf-spacing-lg);
}

/* Submit Area */
.ctf-submit-area {
    margin-top: var(--ctf-spacing-xl);
    padding: var(--ctf-spacing-lg);
    background: var(--ctf-primary-light);
    border-radius: 6px;
    text-align: center;
}

.ctf-trust-note {
    background: white;
    padding: var(--ctf-spacing-lg);
    border-left: 4px solid var(--ctf-primary);
    border-radius: 4px;
    margin-bottom: var(--ctf-spacing-lg);
    font-size: 14px;
    color: var(--ctf-text-light);
    text-align: left;
}

.ctf-trust-note strong {
    color: var(--ctf-text-dark);
    display: block;
    margin-bottom: var(--ctf-spacing-sm);
}

.ctf-button {
    display: inline-block;
    padding: 14px 48px;
    background: var(--ctf-primary);
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--ctf-spacing-lg);
    letter-spacing: 0.5px;
}

.ctf-button:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ctf-button:active {
    transform: translateY(0);
}

.ctf-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.ctf-submit-note {
    font-size: 12px;
    color: var(--ctf-text-light);
    margin-top: var(--ctf-spacing-md);
}

/* Thank You Message */
.ctf-thank-you {
    text-align: center;
    padding: var(--ctf-spacing-xl);
    background: var(--ctf-primary-light);
    border-radius: 6px;
    animation: slideIn 0.4s ease;
}

.ctf-thank-you-content h2 {
    font-size: 24px;
    color: var(--ctf-text-dark);
    margin-bottom: var(--ctf-spacing-md);
}

.ctf-thank-you-content p {
    font-size: 15px;
    color: var(--ctf-text-light);
    margin-bottom: var(--ctf-spacing-md);
    line-height: 1.6;
}

.ctf-thank-you-note {
    font-size: 12px;
    color: var(--ctf-text-light);
    font-style: italic;
    margin-top: var(--ctf-spacing-lg);
    padding-top: var(--ctf-spacing-lg);
    border-top: 1px solid var(--ctf-border);
}

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

.ctf-form.ctf-loading .ctf-button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Error State */
.ctf-input.ctf-error,
.ctf-select.ctf-error {
    border-color: var(--ctf-error);
    background-color: #fff5f5;
}

.ctf-field-error {
    color: var(--ctf-error);
    font-size: 12px;
    margin-top: var(--ctf-spacing-xs);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .ctf-form-wrapper {
        padding: var(--ctf-spacing-lg);
    }
    
    .ctf-form-header h2 {
        font-size: 22px;
    }
    
    .ctf-section {
        padding: var(--ctf-spacing-md);
    }
    
    .ctf-radio-group,
    .ctf-checkbox-group {
        gap: var(--ctf-spacing-sm);
    }
    
    .ctf-button {
        width: 100%;
        padding: 16px var(--ctf-spacing-md);
    }
}

/* Print Styles */
@media print {
    .ctf-submit-area,
    .ctf-trust-note {
        display: none;
    }
}

/* ── Multi-step Wizard Additions ─────────────────────────────────────────── */

/* Progress wrapper */
.ctf-progress-wrapper {
    max-width: 800px;
    margin: 0 auto var(--ctf-spacing-xl);
    padding: var(--ctf-spacing-lg) var(--ctf-spacing-lg) var(--ctf-spacing-md);
    background: #fff;
    border: 1px solid var(--ctf-border);
    border-radius: 8px;
}

/* Track + fill */
.ctf-progress-track {
    position: relative;
    height: 6px;
    background: var(--ctf-border);
    border-radius: 99px;
    margin-bottom: var(--ctf-spacing-md);
    overflow: hidden;
}
.ctf-progress-fill {
    height: 100%;
    background: var(--ctf-primary);
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Step dots row */
.ctf-step-dots {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--ctf-spacing-sm);
}
.ctf-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    transition: background 0.3s, color 0.3s, transform 0.2s;
    flex-shrink: 0;
}
.ctf-step-dot.active {
    background: var(--ctf-primary);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 0 4px var(--ctf-primary-light);
}
.ctf-step-dot.completed {
    background: var(--ctf-success);
    color: #fff;
}
.ctf-step-dot.completed span::before {
    content: '✓';
}
.ctf-step-dot.completed span {
    font-size: 0;
}
.ctf-step-dot.completed span::before {
    font-size: 13px;
}

/* Step text */
.ctf-progress-text {
    text-align: center;
    font-size: 13px;
    color: var(--ctf-text-light);
    font-weight: 500;
    margin-top: var(--ctf-spacing-xs);
}

/* Nav area (Back / Next) */
.ctf-nav-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--ctf-spacing-lg);
    padding-top: var(--ctf-spacing-lg);
    border-top: 1px solid var(--ctf-border);
}
.ctf-btn-prev {
    background: transparent !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}
.ctf-btn-prev:hover {
    background: rgba(255,255,255,0.15) !important;
    transform: translateY(-1px);
    box-shadow: none;
}
.ctf-btn-next {
    margin-left: auto;
}

/* Radio group error highlight */
.ctf-radio-group.ctf-error label {
    color: var(--ctf-error);
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .ctf-step-dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .ctf-nav-area {
        gap: var(--ctf-spacing-sm);
    }
    .ctf-btn-prev,
    .ctf-btn-next {
        padding: 12px 20px;
        font-size: 14px;
    }
}
