/* ================================================================
   CARGO QUOTE FORM — Blue Sun Shipping Style
   Colors: #342BD8 (primary) / #5047FC (accent)
   Font:   Montserrat
   ================================================================ */

:root {
    --cqf-primary:    #342BD8;
    --cqf-primary-d:  #2921B0;
    --cqf-primary-l:  #4A42E0;
    --cqf-accent:     #5047FC;
    --cqf-accent-l:   #EEEDFF;
    --cqf-accent-glow: rgba(80, 71, 252, .15);
    --cqf-dark:       #0D0B2E;
    --cqf-dark-2:     #1A1745;
    --cqf-bg:         #F5F5FB;
    --cqf-surface:    #FFFFFF;
    --cqf-border:     #E0DFF0;
    --cqf-border-focus: #5047FC;
    --cqf-text:       #1A1745;
    --cqf-text-muted: #7B789A;
    --cqf-text-light: #A9A7C1;
    --cqf-danger:     #E03E3E;
    --cqf-success:    #10B981;
    --cqf-radius:     10px;
    --cqf-radius-lg:  16px;
    --cqf-shadow:     0 2px 8px rgba(13,11,46,.06), 0 8px 24px rgba(13,11,46,.04);
    --cqf-transition: .25s cubic-bezier(.4,0,.2,1);
    --cqf-font:       'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Reset & Wrapper ---- */
.cqf-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: var(--cqf-font);
    color: var(--cqf-text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cqf-wrapper *, .cqf-wrapper *::before, .cqf-wrapper *::after {
    box-sizing: border-box;
}

/* ---- RTL support ---- */
.cqf-wrapper[dir="rtl"] {
    direction: rtl;
    text-align: right;
}
.cqf-wrapper[dir="rtl"] .cqf-nav {
    flex-direction: row-reverse;
}
.cqf-wrapper[dir="rtl"] .cqf-btn-outline { order: 2; }
.cqf-wrapper[dir="rtl"] .cqf-btn:not(.cqf-btn-outline) { order: 1; }

/* ================================================================
   STEP INDICATOR — wrapping grid of dots with labels
   ================================================================ */
.cqf-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 0;
}

.cqf-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--cqf-surface);
    border: 1.5px solid var(--cqf-border);
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--cqf-transition);
    font-size: 13px;
    font-weight: 500;
    color: var(--cqf-text-muted);
    font-family: var(--cqf-font);
    letter-spacing: .01em;
}
.cqf-step:hover {
    border-color: var(--cqf-accent);
    color: var(--cqf-accent);
    background: var(--cqf-accent-l);
}
.cqf-step.active {
    background: var(--cqf-primary);
    border-color: var(--cqf-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(52,43,216,.3);
}
.cqf-step.completed {
    background: var(--cqf-accent-l);
    border-color: var(--cqf-accent);
    color: var(--cqf-accent);
}

.cqf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(123,120,154,.12);
    flex-shrink: 0;
}
.cqf-step.active .cqf-step-num {
    background: rgba(255,255,255,.25);
}
.cqf-step.completed .cqf-step-num {
    background: var(--cqf-accent);
    color: #fff;
}

.cqf-step-label {
    font-weight: 600;
}

/* ================================================================
   PANELS — form card for each step
   ================================================================ */
.cqf-panel {
    display: none;
    border: 1.5px solid var(--cqf-border);
    border-radius: var(--cqf-radius-lg);
    background: var(--cqf-surface);
    padding: 2.5rem;
    box-shadow: var(--cqf-shadow);
    animation: cqfSlideUp .4s ease;
}
.cqf-panel.active {
    display: block;
}

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

/* Section heading */
.cqf-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cqf-dark);
    margin: 0 0 .35rem;
    padding: 0;
    border: none;
    letter-spacing: -.01em;
}
.cqf-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background: var(--cqf-accent);
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: text-bottom;
}
.cqf-wrapper[dir="rtl"] .cqf-section-title::before {
    margin-right: 0;
    margin-left: 10px;
}

.cqf-section-desc {
    color: var(--cqf-text-muted);
    font-size: 14px;
    margin: 0 0 1.75rem;
    font-weight: 400;
}

/* ================================================================
   GRID — two-column layout
   ================================================================ */
.cqf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.75rem;
}

/* ================================================================
   FIELDS — inputs, selects, textareas
   ================================================================ */
.cqf-field {
    display: flex;
    flex-direction: column;
}
.cqf-field-full {
    grid-column: 1 / -1;
}

.cqf-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cqf-text);
    margin-bottom: 6px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.cqf-field input[type="text"],
.cqf-field input[type="email"],
.cqf-field input[type="tel"],
.cqf-field input[type="number"],
.cqf-field input[type="date"],
.cqf-field select,
.cqf-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--cqf-border);
    border-radius: var(--cqf-radius);
    font-size: 14.5px;
    font-family: var(--cqf-font);
    font-weight: 400;
    color: var(--cqf-text);
    background: var(--cqf-bg);
    transition: border-color var(--cqf-transition), box-shadow var(--cqf-transition), background var(--cqf-transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.cqf-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237B789A' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.cqf-wrapper[dir="rtl"] .cqf-field select {
    background-position: left 14px center;
    padding-right: 14px;
    padding-left: 36px;
}

.cqf-field input:focus,
.cqf-field select:focus,
.cqf-field textarea:focus {
    border-color: var(--cqf-border-focus);
    box-shadow: 0 0 0 3px var(--cqf-accent-glow);
    background: #fff;
}
.cqf-field input.cqf-invalid,
.cqf-field select.cqf-invalid,
.cqf-field textarea.cqf-invalid {
    border-color: var(--cqf-danger);
    box-shadow: 0 0 0 3px rgba(224,62,62,.1);
}
.cqf-field textarea {
    resize: vertical;
    min-height: 70px;
}

.cqf-field input::placeholder,
.cqf-field textarea::placeholder {
    color: var(--cqf-text-light);
    font-weight: 400;
}

/* ================================================================
   DROPZONE — file upload area
   ================================================================ */
.cqf-dropzone {
    position: relative;
    border: 2px dashed var(--cqf-border);
    border-radius: var(--cqf-radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--cqf-bg);
    cursor: pointer;
    transition: all var(--cqf-transition);
}
.cqf-dropzone:hover,
.cqf-dropzone.drag-over {
    border-color: var(--cqf-accent);
    background: var(--cqf-accent-l);
    box-shadow: 0 0 0 4px var(--cqf-accent-glow);
}
.cqf-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.cqf-dropzone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--cqf-text-muted);
    font-size: 14px;
    pointer-events: none;
    font-weight: 500;
}
.cqf-dropzone-text svg {
    opacity: .45;
}

.cqf-file-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.cqf-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1.5px solid var(--cqf-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--cqf-text);
}
.cqf-file-item button {
    background: none;
    border: none;
    color: var(--cqf-danger);
    cursor: pointer;
    font-size: 18px;
    font-family: var(--cqf-font);
    padding: 0 4px;
    font-weight: 700;
    transition: transform .15s;
}
.cqf-file-item button:hover {
    transform: scale(1.2);
}

/* ================================================================
   CONSENT CHECKBOXES
   ================================================================ */
.cqf-consent-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 1.75rem 0;
}
.cqf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    color: var(--cqf-text);
    cursor: pointer;
    line-height: 1.55;
    font-weight: 400;
}
.cqf-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--cqf-accent);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ================================================================
   NAVIGATION BUTTONS — clearly visible, high contrast
   ================================================================ */
.cqf-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.25rem;
    gap: 12px;
}

.cqf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 100px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--cqf-font);
    cursor: pointer;
    transition: all var(--cqf-transition);
    background: var(--cqf-primary);
    color: #fff;
    letter-spacing: .01em;
}
.cqf-btn:hover {
    background: var(--cqf-primary-l);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(52,43,216,.3);
}
.cqf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52,43,216,.2);
}

/* Back / Outline button — clearly visible with dark border and text */
.cqf-btn-outline {
    background: var(--cqf-bg);
    color: var(--cqf-dark);
    border: 2px solid var(--cqf-primary);
}
.cqf-btn-outline:hover {
    background: var(--cqf-accent-l);
    color: var(--cqf-primary);
    border-color: var(--cqf-primary);
    box-shadow: 0 2px 8px rgba(52,43,216,.12);
    transform: none;
}

/* Submit CTA — gradient */
.cqf-btn-submit {
    background: linear-gradient(135deg, var(--cqf-primary) 0%, var(--cqf-accent) 100%);
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 100px;
    color: #fff;
}
.cqf-btn-submit:hover {
    background: linear-gradient(135deg, var(--cqf-primary-l) 0%, #6860FF 100%);
    box-shadow: 0 6px 24px rgba(80,71,252,.35);
}

.cqf-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================================================
   SUCCESS / ERROR MESSAGES
   ================================================================ */
.cqf-message {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--cqf-radius-lg);
    animation: cqfSlideUp .4s ease;
}
.cqf-message-success {
    background: linear-gradient(180deg, #ECFDF5 0%, #F0FDF9 100%);
    border: 1.5px solid #A7F3D0;
    color: var(--cqf-success);
}
.cqf-message-success svg {
    margin-bottom: .75rem;
}
.cqf-message-success h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    color: var(--cqf-dark);
}
.cqf-message-success p {
    color: var(--cqf-text-muted);
    margin: 0;
    font-weight: 400;
}

.cqf-message-error {
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    color: var(--cqf-danger);
}
.cqf-message-error h3 {
    margin: 0 0 .5rem;
    font-weight: 700;
}
.cqf-message-error p {
    color: var(--cqf-text-muted);
    margin: 0;
}

/* ================================================================
   SPINNER
   ================================================================ */
.cqf-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cqfSpin .6s linear infinite;
}
@keyframes cqfSpin { to { transform: rotate(360deg); } }

/* ================================================================
   FLAG / COUNTRY SELECT
   ================================================================ */
.cqf-country-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================================================================
   RESPONSIVE — TABLET  (max 768px)
   ================================================================ */
@media (max-width: 768px) {
    .cqf-wrapper {
        padding: 1.25rem 1rem;
    }
    .cqf-panel {
        padding: 1.75rem 1.25rem;
        border-radius: var(--cqf-radius);
    }
    .cqf-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem 1.25rem;
    }
    .cqf-section-title {
        font-size: 1.15rem;
    }
    .cqf-steps {
        gap: 6px;
    }
    .cqf-step {
        padding: 7px 12px;
        font-size: 12px;
        gap: 6px;
    }
    .cqf-step-num {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
}

/* ================================================================
   RESPONSIVE — MOBILE  (max 576px)
   Steps become a compact dot progress bar, everything stacks
   ================================================================ */
@media (max-width: 576px) {
    .cqf-wrapper {
        margin: 0;
        padding: 1rem .75rem;
        font-size: 14px;
    }

    /* Steps: compact numbered circles that wrap naturally */
    .cqf-steps {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-bottom: 1.25rem;
        padding: 0;
    }
    .cqf-step {
        padding: 8px 4px;
        font-size: 11px;
        gap: 4px;
        justify-content: center;
        border-radius: 8px;
        min-width: 0;
    }
    .cqf-step-label {
        display: none;
    }
    .cqf-step-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Panels */
    .cqf-panel {
        padding: 1.25rem 1rem;
        border-radius: var(--cqf-radius);
        box-shadow: 0 1px 4px rgba(13,11,46,.05);
    }

    /* Grid becomes single column */
    .cqf-grid {
        grid-template-columns: 1fr;
        gap: .875rem;
    }

    /* Section heading */
    .cqf-section-title {
        font-size: 1.05rem;
    }
    .cqf-section-title::before {
        width: 3px;
        margin-right: 8px;
    }
    .cqf-section-desc {
        font-size: 13px;
        margin-bottom: 1.25rem;
    }

    /* Labels */
    .cqf-field label {
        font-size: 11.5px;
    }

    /* Inputs — larger touch targets, 16px to prevent iOS zoom */
    .cqf-field input[type="text"],
    .cqf-field input[type="email"],
    .cqf-field input[type="tel"],
    .cqf-field input[type="number"],
    .cqf-field input[type="date"],
    .cqf-field select,
    .cqf-field textarea {
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
    }

    /* Dropzone */
    .cqf-dropzone {
        padding: 1.75rem 1rem;
        border-radius: var(--cqf-radius);
    }
    .cqf-dropzone-text {
        font-size: 13px;
    }

    /* Consent */
    .cqf-checkbox-label {
        font-size: 12.5px;
        gap: 10px;
    }
    .cqf-checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* Nav buttons — full width stacked */
    .cqf-nav {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 1.5rem;
    }
    .cqf-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
    }
    .cqf-btn-submit {
        width: 100%;
        padding: 15px 20px;
        font-size: 15px;
    }
    .cqf-btn-outline {
        width: 100%;
    }

    /* Messages */
    .cqf-message {
        padding: 2rem 1.25rem;
    }
    .cqf-message-success h3 {
        font-size: 1.1rem;
    }

    /* File list */
    .cqf-file-item {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ================================================================
   RESPONSIVE — VERY SMALL  (max 380px)
   ================================================================ */
@media (max-width: 380px) {
    .cqf-wrapper {
        padding: .75rem .5rem;
    }
    .cqf-panel {
        padding: 1rem .75rem;
    }
    .cqf-steps {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    .cqf-step {
        padding: 6px 2px;
    }
    .cqf-step-num {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    .cqf-section-title {
        font-size: 1rem;
    }
    .cqf-field label {
        font-size: 11px;
    }
    .cqf-btn {
        font-size: 13px;
        padding: 13px 16px;
    }
}
