/* ============================================================
   QuoteTek — Custom styles
   Bootstrap 5.3 base + overrides
   ============================================================ */

/* ─── CSS variables — CoOptek brand ─────────────────────────── */
:root {
    --qt-primary:       #007cd5;   /* CoOptek blue */
    --qt-primary-dark:  #0267af;   /* CoOptek blue hover */
    --qt-primary-light: #dbeeff;
    --qt-navy:          #00233c;   /* CoOptek dark navy */
    --qt-accent:        #007cd5;
    --qt-success:       #10B981;
    --qt-border-radius: 0.75rem;
    --qt-shadow:        0 4px 24px rgba(0, 35, 60, 0.10);
    --qt-shadow-hover:  0 8px 32px rgba(0, 124, 213, 0.22);

    /* Bootstrap overrides */
    --bs-primary:       #007cd5;
    --bs-primary-rgb:   0, 124, 213;
    --bs-link-color:    #007cd5;
}

[data-bs-theme="dark"] {
    --qt-primary-light: #0a2a45;
    --qt-shadow:        0 4px 24px rgba(0, 0, 0, 0.32);
    --qt-shadow-hover:  0 8px 32px rgba(0, 124, 213, 0.30);
}

/* ─── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Ubuntu', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Bootstrap primary color override */
.btn-primary { background-color: #007cd5; border-color: #007cd5; }
.btn-primary:hover, .btn-primary:focus { background-color: #0267af; border-color: #0267af; }
.btn-outline-primary { color: #007cd5; border-color: #007cd5; }
.btn-outline-primary:hover { background-color: #007cd5; border-color: #007cd5; }
.text-primary { color: #007cd5 !important; }
.bg-primary { background-color: #007cd5 !important; }
.badge.bg-primary { background-color: #007cd5 !important; }
.bg-primary-subtle { background-color: #dbeeff !important; }
.text-primary-emphasis { color: #0267af !important; }
a { color: #007cd5; }
a:hover { color: #0267af; }

/* ─── Navbar ─────────────────────────────────────────────────── */
.qt-navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .qt-navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .qt-navbar {
    background: rgba(15, 23, 42, 0.9) !important;
}

.qt-logo-cooptek {
    height: 32px;
    width: auto;
}

/* Logo switching handled by theme.js */

/* ─── Hero ───────────────────────────────────────────────────── */
.qt-hero {
    padding: 5rem 0 3rem;
    background: linear-gradient(135deg, #00233c 0%, #003d6b 45%, #007cd5 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.qt-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.qt-hero .badge-pill {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* ─── Step progress bar ──────────────────────────────────────── */
.qt-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.5rem 0;
}

.qt-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 120px;
}

.qt-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.qt-step.active .qt-step-circle {
    background: var(--qt-primary);
    border-color: var(--qt-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.qt-step.completed .qt-step-circle {
    background: var(--qt-success);
    border-color: var(--qt-success);
    color: #fff;
}

.qt-step-label {
    font-size: 0.68rem;
    text-align: center;
    margin-top: 0.4rem;
    color: var(--bs-secondary-color);
    line-height: 1.2;
    max-width: 72px;
}

.qt-step.active .qt-step-label {
    color: var(--qt-primary);
    font-weight: 600;
}

.qt-step.completed .qt-step-label {
    color: var(--qt-success);
}

/* Connector line between steps */
.qt-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
    background: var(--bs-border-color);
    z-index: 1;
}

.qt-step.completed:not(:last-child)::after {
    background: var(--qt-success);
}

/* ─── Form card ──────────────────────────────────────────────── */
.qt-form-card {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--qt-border-radius);
    box-shadow: var(--qt-shadow);
}

/* ─── Step panels ────────────────────────────────────────────── */
.qt-step-panel {
    display: none;
}

.qt-step-panel.active {
    display: block;
}

.qt-step-panel.animate-in {
    animation: qtFadeIn 1s ease;
}

@keyframes qtFadeIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ─── Transition BOM (étape 2 → 3) ─────────────────────────── */
.qt-bom-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.qt-bom-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bs-primary);
    animation: qtDotPulse 1.4s ease-in-out infinite;
}

.qt-bom-dot:nth-child(2) { animation-delay: 0.2s; }
.qt-bom-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes qtDotPulse {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40%           { transform: scale(1);   opacity: 1; }
}

.qt-bom-msg-wrap {
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ─── Service type cards ─────────────────────────────────────── */
.qt-service-card {
    border: 2px solid var(--bs-border-color);
    border-radius: var(--qt-border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--bs-body-bg);
    user-select: none;
}

.qt-service-card:hover {
    border-color: var(--qt-primary);
    box-shadow: var(--qt-shadow-hover);
    transform: translateY(-2px);
}

.qt-service-card.selected {
    border-color: var(--qt-primary);
    background: var(--qt-primary-light);
    box-shadow: var(--qt-shadow-hover);
}

.qt-service-card .service-icon {
    font-size: 2.5rem;
    color: var(--bs-secondary-color);
    transition: color 0.2s;
    line-height: 1;
}

.qt-service-card.selected .service-icon,
.qt-service-card:hover .service-icon {
    color: var(--qt-primary);
}

.qt-service-card .service-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0.6rem 0 0.25rem;
}

.qt-service-card .service-desc {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
}

/* ─── File drop zone ─────────────────────────────────────────── */
.qt-drop-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--qt-border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.qt-drop-zone:hover,
.qt-drop-zone.drag-over {
    border-color: var(--qt-primary);
    background: var(--qt-primary-light);
}

.qt-drop-zone.has-file {
    border-color: var(--qt-success);
    border-style: solid;
    background: rgba(16, 185, 129, 0.06);
}

.qt-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.qt-drop-zone .drop-icon {
    font-size: 2rem;
    color: var(--bs-secondary-color);
}

.qt-drop-zone.has-file .drop-icon {
    color: var(--qt-success);
}

.qt-drop-zone .drop-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-top: 0.4rem;
}

.qt-drop-zone .drop-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--qt-success);
    margin-top: 0.3rem;
}

/* ─── Multi-file drop zone (step 2) ─────────────────────────── */
.qt-drop-zone-multi {
    padding: 2.5rem 2rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qt-drop-zone-multi .drop-icon {
    font-size: 2.5rem;
}

.qt-drop-zone-multi.has-file {
    padding: 1.25rem 2rem;
    min-height: auto;
}

.qt-drop-zone-multi.has-file .drop-icon {
    font-size: 1.5rem;
    color: var(--qt-success);
}

/* ─── Summary (step 6) ───────────────────────────────────────── */
.qt-summary-section {
    background: var(--bs-tertiary-bg);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.qt-summary-section h6 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.qt-summary-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.88rem;
    padding: 0.15rem 0;
}

.qt-summary-row .label {
    color: var(--bs-secondary-color);
    min-width: 160px;
    flex-shrink: 0;
}

.qt-summary-row .value {
    font-weight: 500;
}

/* ─── Progress bar (upload) ──────────────────────────────────── */
#qt-submit-progress {
    display: none;
}

/* ─── Status badges ──────────────────────────────────────────── */
.badge-new        { background-color: #2563EB; }
.badge-in_review  { background-color: #D97706; }
.badge-quoted     { background-color: #7C3AED; }
.badge-accepted   { background-color: #059669; }
.badge-rejected   { background-color: #DC2626; }
.badge-cancelled  { background-color: #6B7280; }

/* ─── Admin table ────────────────────────────────────────────── */
.qt-admin-table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.qt-admin-table td {
    vertical-align: middle;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .qt-step-label { display: none; }
    .qt-step-circle { width: 28px; height: 28px; font-size: 0.7rem; }
    .qt-step:not(:last-child)::after { top: 14px; }
}

.text-purple { color: #7c3aed; }

/* ─── Gerber split view (Recto + Verso côte à côte, côté client) ──── */
/* feedback #29 — en dessous de 800px, les 2 panneaux passent en colonne */
@media (max-width: 799.98px) {
    .qt-gv-split-row { flex-direction: column !important; }
    .qt-gv-split-pane { width: 100%; }
}
