/* =============================================================
   Transtak ROI Calculator – Frontend Styles
   ============================================================= */

:root {
    --tn:      #0f1d68;   /* transtak navy   */
    --tb:      #2d6db5;   /* transtak blue   */
    --to:      #e87722;   /* transtak orange */
    --tl:      #f4f6fa;   /* light bg        */
    --tw:      #ffffff;
    --td:      #2c3e50;   /* dark text       */
    --tg:      #6b7a8d;   /* grey text       */
    --border:  #dde3ed;
    --radius:  10px;
    --shadow:  0 4px 24px rgba(26,52,97,.10);
    --shadow-sm: 0 2px 8px rgba(26,52,97,.08);
}

/* Wrapper ---------------------------------------------------- */
#transtak-roi-wrap {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 48px;
    color: var(--td);
}

/* Progress bar ----------------------------------------------- */
.troi-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 32px 0 36px;
    padding: 0;
    list-style: none;
}

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

.troi-step-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
    background: var(--border);
    transition: background .3s;
    z-index: 0;
}

.troi-step-node.done:not(:last-child)::after,
.troi-step-node.active:not(:last-child)::after {
    background: var(--tb);
}

.troi-step-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--tw);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--tg);
    z-index: 1;
    transition: all .3s;
}

.troi-step-node.active .troi-step-bubble {
    border-color: #0f1d68;
    background: #0f1d68;
    color: var(--tw);
}

.troi-step-node.done .troi-step-bubble {
    border-color: #0f1d68;
    background: #0f1d68;
    color: var(--tw);
}


.troi-step-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--tg);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: color .3s;
}

.troi-step-node.active .troi-step-label,
.troi-step-node.done .troi-step-label {
    color: #0f1d68;
}

/* Card ------------------------------------------------------- */
.troi-card {
    background: var(--tw);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 40px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .troi-card { padding: 24px 18px; }
}

.troi-card-header {
    margin-bottom: 28px;
}

.troi-card-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--tn);
    margin: 0 0 6px;
}

.troi-card-header p {
    font-size: 14px;
    color: var(--tg);
    margin: 0;
    line-height: 1.55;
}

/* Form fields ----------------------------------------------- */
.troi-field {
    margin-bottom: 20px;
}

.troi-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--td);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.troi-field input[type="number"],
.troi-field input[type="text"],
.troi-field input[type="email"],
.troi-field input[type="tel"],
.troi-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--td);
    background: var(--tw);
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.troi-field input:focus,
.troi-field select:focus {
    border-color: var(--tb);
    box-shadow: 0 0 0 3px rgba(45,109,181,.12);
}

.troi-field .helper {
    font-size: 12px;
    color: var(--tg);
    margin-top: 5px;
}

/* Two-column grid */
.troi-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 580px) {
    .troi-grid-2 { grid-template-columns: 1fr; }
}

/* Trailer model cards --------------------------------------- */
.troi-trailer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

.troi-trailer-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    cursor: pointer;
    transition: all .2s;
    background: var(--tl);
    text-align: left;
}

.troi-trailer-card:hover {
    border-color: var(--tb);
    background: #f0f6ff;
}

.troi-trailer-card.selected {
    border-color: var(--tn);
    background: #e8f0fb;
    box-shadow: var(--shadow-sm);
}

.troi-trailer-card .tc-model {
    font-weight: 700;
    font-size: 16px;
    color: var(--tn);
    margin-bottom: 4px;
}

.troi-trailer-card .tc-bins {
    font-size: 13px;
    color: var(--tg);
    margin-bottom: 8px;
}

.troi-trailer-card .tc-img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #eee;
}

.troi-trailer-card .tc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.troi-trailer-card .tc-badge {
    display: inline-block;
    background: var(--tn);
    color: var(--tw);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.troi-trailer-card.selected .tc-badge {
    background: #0f1d68;
}

/* Custom trailer inputs */
#troi-custom-trailer {
    background: var(--tl);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-top: 16px;
}

/* Advanced accordion --------------------------------------- */
.troi-accordion {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 8px;
}

.troi-accordion summary {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--tn);
    cursor: pointer;
    background: var(--tl);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.troi-accordion summary::before {
    content: '▶';
    font-size: 10px;
    transition: transform .2s;
    display: inline-block;
}

.troi-accordion[open] summary::before {
    transform: rotate(90deg);
}

.troi-accordion-body {
    padding: 20px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 580px) {
    .troi-accordion-body { grid-template-columns: 1fr; }
}

/* Navigation buttons --------------------------------------- */
.troi-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.troi-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    letter-spacing: .3px;
}

.troi-btn-primary {
    background: var(--tw);
    color: #0f1d68;
    box-shadow: 0 4px 14px rgba(15,29,104,.15);
    border: 2px solid #0f1d68;
}

.troi-btn-primary:hover {
    background: #f0f3ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15,29,104,.20);
}

.troi-btn-result {
    flex: 1 !important;
    justify-content: center !important;
    background: #0f1d68 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 14px rgba(15,29,104,.20) !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 13px 28px !important;
    line-height: 1.4 !important;
    letter-spacing: .3px !important;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.troi-btn-result:hover,
.troi-btn-result:focus,
.troi-btn-result:visited {
    background: #0a1550 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15,29,104,.28) !important;
    text-decoration: none !important;
}

.troi-btn-secondary {
    background: transparent;
    color: var(--tn);
    border: 2px solid var(--border);
}

.troi-btn-secondary:hover {
    border-color: var(--tn);
    background: var(--tl);
}

.troi-btn-ghost {
    background: none;
    color: var(--tg);
    padding-left: 0;
    font-size: 14px;
    font-weight: 600;
}

.troi-btn-ghost:hover { color: var(--tn); }


/* Results panel -------------------------------------------- */
#troi-step-results { display: none; }

.troi-results-hero {
    background: #0f1d68;
    border-radius: var(--radius);
    padding: 32px;
    color: var(--tw);
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    position: relative;
}

.troi-hero-finetune {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.troi-btn-finetune {
    background: transparent !important;
    color: rgba(255,255,255,0.65) !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 0 !important;
    cursor: pointer !important;
    letter-spacing: .3px !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

.troi-btn-finetune:hover {
    color: rgba(255,255,255,1) !important;
    transform: none !important;
    box-shadow: none !important;
}

@media (max-width: 600px) {
    .troi-results-hero { grid-template-columns: 1fr; }
}

.troi-kpi-box { }

.troi-kpi-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    opacity: .75;
    margin-bottom: 6px;
}

.troi-kpi-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.troi-kpi-sub {
    font-size: 14px;
    opacity: .80;
}

/* Result sections */
.troi-result-section {
    background: var(--tw);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.troi-result-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--tn);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tl);
}

/* Bar comparison */
.troi-bar-row {
    margin-bottom: 18px;
}

.troi-bar-row:last-child { margin-bottom: 0; }

.troi-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 7px;
}

.troi-bar-label .name { font-weight: 600; color: var(--td); }
.troi-bar-label .val  { font-weight: 700; color: var(--tn); }

.troi-bar-track {
    width: 100%;
    height: 12px;
    background: var(--tl);
    border-radius: 999px;
    overflow: hidden;
}

.troi-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .8s cubic-bezier(.22,1,.36,1);
}

.troi-bar-fill.current  { background: #b0bac8; }
.troi-bar-fill.trailer  { background: var(--tb); }

.troi-bar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--tg);
    margin-top: 5px;
}

/* Stat grid inside results */
.troi-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 500px) {
    .troi-stat-grid { grid-template-columns: 1fr; }
}

.troi-stat {
    background: var(--tl);
    border-radius: 8px;
    padding: 14px 16px;
}

.troi-stat-label {
    font-size: 12px;
    color: var(--tg);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 4px;
}

.troi-stat-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--tn);
}

.troi-stat-desc {
    font-size: 12px;
    color: var(--tg);
    margin-top: 2px;
}

/* Callout box */
.troi-callout {
    background: #f0f3ff;
    border-left: 4px solid #0f1d68;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--td);
    margin-top: 16px;
}

/* Results actions */
.troi-results-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Session banner */
.troi-session-banner {
    background: #f0f6ff;
    border: 1.5px solid #cdd9f0;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 13px;
    color: var(--tb);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.troi-session-banner svg {
    flex-shrink: 0;
}

/* Privacy note */
.troi-privacy {
    font-size: 12px;
    color: var(--tg);
    margin-top: 12px;
    text-align: center;
}

.troi-privacy a { color: var(--tb); }

/* Calculation log */
.troi-calc-log {
    margin-top: 24px;
}

.troi-calc-log h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--tn);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 10px;
}

.troi-calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--tl);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 13px;
}

.troi-calc-item .ci-label { color: var(--tg); }
.troi-calc-item .ci-val   { font-weight: 700; color: var(--tn); }

/* Loading state */
.troi-btn.loading {
    opacity: .7;
    pointer-events: none;
}

.troi-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: troi-spin .7s linear infinite;
    margin-left: 4px;
}

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

/* Error message */
.troi-error {
    background: #fff2f2;
    border: 1.5px solid #f5c2c2;
    border-radius: 6px;
    padding: 12px 16px;
    color: #c0392b;
    font-size: 13px;
    margin-top: 12px;
}

/* Validation inline */
.troi-field.has-error input,
.troi-field.has-error select {
    border-color: #e74c3c;
}

.troi-field .field-error {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
}

/* Step hidden/shown */
.troi-step { display: none; }
.troi-step.active { display: block; }

/* Intro hero above wizard */
.troi-intro {
    background: #0f1d68;
    color: var(--tw);
    border-radius: var(--radius);
    padding: 36px 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.troi-intro::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}

.troi-intro h2 {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 16px 0 10px !important;
    position: relative;
    z-index: 1;
}

.troi-intro p {
    font-size: 15px;
    opacity: .85;
    margin: 0;
    max-width: 560px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.troi-intro .troi-tag {
    display: inline-block;
    background: var(--tw);
    color: #0f1d68;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 12px;
}
