/* ── GP Thamani ya Gari Calculator ─────────────────────────────────────────── */

.gp-thamani-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    font-family: inherit;
}

.gp-thamani-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    padding: 28px 24px;
}

.gp-thamani-card h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 900;
    color: #111;
    text-align: center;
}

.gp-thamani-subtitle {
    margin: 0 0 22px;
    text-align: center;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Progress dots ── */

.gp-thamani-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.gp-thamani-progress span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f1f1;
    color: #999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    transition: background .2s, color .2s;
}

.gp-thamani-progress span.is-active {
    background: #ff7a00;
    color: #fff;
}

.gp-thamani-progress em {
    width: 28px;
    height: 2px;
    background: #eee;
    display: inline-block;
}

/* ── Stages ── */

.gp-thamani-stage { display: none; }
.gp-thamani-stage.is-active { display: block; }

.gp-thamani-stage-title {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 900;
    color: #111;
}

/* ── Stage 1: Intent selection (Kuuza / Kununua) ── */

.gp-thamani-intent-note {
    margin: 0 0 18px;
    text-align: center;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.gp-thamani-intent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.gp-thamani-intent-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 3px solid #c9c9c9;   /* prominent default border */
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

/* ── Sell card (Nataka Kuuza) — orange theme ── */
.gp-thamani-intent-card[data-intent="sell"] {
    border-color: #ffb070;
}
.gp-thamani-intent-card[data-intent="sell"]:hover {
    border-color: #ff7a00;
    background: #fffaf5;
    box-shadow: 0 6px 18px rgba(255,122,0,.18);
    transform: translateY(-2px);
}
.gp-thamani-intent-card[data-intent="sell"].is-selected {
    border-color: #ff7a00;
    background: #fff4e8;
    box-shadow: 0 6px 18px rgba(255,122,0,.22);
}

/* ── Buy card (Nataka Kununua) — blue theme ── */
.gp-thamani-intent-card[data-intent="buy"] {
    border-color: #6fa8ff;
}
.gp-thamani-intent-card[data-intent="buy"]:hover {
    border-color: #1a73e8;
    background: #f5f9ff;
    box-shadow: 0 6px 18px rgba(26,115,232,.18);
    transform: translateY(-2px);
}
.gp-thamani-intent-card[data-intent="buy"].is-selected {
    border-color: #1a73e8;
    background: #e8f0fe;
    box-shadow: 0 6px 18px rgba(26,115,232,.22);
}
.gp-thamani-intent-card[data-intent="buy"] .gp-intent-icon,
.gp-thamani-intent-card[data-intent="buy"] .gp-intent-title {
    color: #1a4fa0;
}

.gp-intent-icon {
    font-size: 36px;
    line-height: 1;
}

.gp-intent-title {
    font-size: 16px;
    font-weight: 900;
    color: #111;
}

.gp-intent-sub {
    font-size: 13px;
    color: #666;
    line-height: 1.45;
}

/* ── Form grid ── */

.gp-thamani-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.gp-thamani-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.gp-thamani-grid input,
.gp-thamani-grid select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    color: #111;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.gp-thamani-grid input:focus,
.gp-thamani-grid select:focus {
    border-color: #ff7a00;
}

.gp-thamani-locked-input {
    background: #f7f7f7 !important;
    color: #888 !important;
    cursor: not-allowed;
}

.gp-thamani-field-note {
    font-weight: 400;
    font-size: 12px;
    color: #999;
}

.gp-hidden { display: none !important; }

/* ── Searchable combobox ── */

.gp-combo { position: relative; }

.gp-combo-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    color: #111;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.gp-combo-input:focus { border-color: #ff7a00; }
.gp-combo-input.is-selected { border-color: #ff7a00; font-weight: 700; }
.gp-combo-input:disabled { background: #f7f7f7; cursor: not-allowed; }

.gp-combo-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 230px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    margin: 0;
    padding: 6px 0;
    list-style: none;
    z-index: 60;
    display: none;
}

.gp-combo-list.is-open { display: block; }

.gp-combo-list li {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
}

.gp-combo-list li:hover,
.gp-combo-list li.is-focused { background: #fff4e8; }
.gp-combo-list li.is-selected-opt { background: #ff7a00; color: #fff; }

.gp-combo-empty {
    color: #999 !important;
    cursor: default !important;
    background: none !important;
}

/* ── Checkboxes ── */

.gp-thamani-checks {
    display: flex;
    gap: 22px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.gp-thamani-checks label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
}

.gp-thamani-checks input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff7a00;
}

/* ── Stage actions ── */

.gp-thamani-stage-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.gp-thamani-btn {
    background: #ff7a00;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: background .15s, transform .15s;
}

.gp-thamani-btn:hover { background: #e96f00; transform: translateY(-1px); }
.gp-thamani-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.gp-thamani-back {
    background: none;
    border: 1.5px solid #ddd;
    color: #666;
    border-radius: 14px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.gp-thamani-back:hover { border-color: #ff7a00; color: #ff7a00; }

.gp-thamani-phone-note {
    background: #fff8f0;
    border: 1px solid #ffe1c2;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: #9a4a00;
    line-height: 1.55;
    margin: 0 0 16px;
}

/* ── OTP modal ── */

.gp-thamani-otp-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gp-thamani-otp-modal.is-open { display: flex; }

.gp-thamani-otp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.gp-thamani-otp-dialog {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 26px 22px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
    text-align: center;
}

.gp-thamani-otp-dialog h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 900;
    color: #111;
}

.gp-thamani-otp-phone {
    margin: 0 0 14px;
    font-size: 14px;
    color: #555;
}

.gp-thamani-otp-countdown {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: #25D366;
}

.gp-thamani-otp-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.gp-thamani-otp-dialog input {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    font-size: 22px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 900;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.gp-thamani-otp-dialog input:focus { border-color: #ff7a00; }

.gp-thamani-otp-dialog .gp-thamani-btn { width: 100%; }

.gp-thamani-otp-resend,
.gp-thamani-otp-change {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #ff7a00;
    font-weight: 700;
    font-size: 14px;
    margin-top: 12px;
    cursor: pointer;
}

.gp-thamani-otp-resend[disabled] { color: #bbb; cursor: not-allowed; }

.gp-thamani-otp-change { color: #888; }

.gp-thamani-otp-whatsapp {
    display: block;
    width: 100%;
    background: #25D366;
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 10px;
    cursor: pointer;
}

.gp-thamani-otp-whatsapp[disabled] { opacity: .6; cursor: not-allowed; }

.gp-thamani-otp-info {
    background: #f0fff4;
    border: 1px solid #b9efc9;
    color: #1a7d36;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.gp-thamani-otp-error {
    background: #fff0f0;
    border: 1px solid #ffc4c4;
    color: #b00020;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ── Loading spinner ── */

#gp-thamani-loading {
    text-align: center;
    padding: 38px 16px;
}

.gp-thamani-spinner {
    width: 46px;
    height: 46px;
    border: 5px solid #ffe1c2;
    border-top-color: #ff7a00;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: gp-thamani-spin .8s linear infinite;
}

@keyframes gp-thamani-spin {
    to { transform: rotate(360deg); }
}

#gp-thamani-loading-text {
    font-size: 15px;
    font-weight: 700;
    color: #9a4a00;
    line-height: 1.5;
}

.gp-thamani-error {
    background: #fff0f0;
    border: 1px solid #ffc4c4;
    color: #b00020;
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-top: 16px;
}

/* ── Result page ── */

.gp-result-page-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.gp-result-page-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0,0,0,.08);
    padding: 28px 24px;
}

.gp-result-page-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.gp-result-page-logo-text {
    font-size: 20px;
    font-weight: 900;
    color: #ff7a00;
    letter-spacing: -.3px;
}

.gp-result-page-badge {
    background: #fff4e8;
    color: #b35400;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
}

.gp-result-page-timestamp {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #999;
}

.gp-result-page-stale-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbea;
    border: 1px solid #ffe39c;
    color: #8a6400;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.gp-result-page-stale-notice svg { flex-shrink: 0; margin-top: 2px; }

.gp-result-page-heading {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 900;
    color: #111;
    line-height: 1.3;
}

.gp-result-page-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.gp-result-spec-item {
    background: #fafafa;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gp-result-spec-item span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    font-weight: 700;
}

.gp-result-spec-item strong {
    font-size: 14px;
    color: #222;
    font-weight: 800;
}

.gp-result-page-main-price {
    background: linear-gradient(135deg, #ff7a00, #ff9b3d);
    border-radius: 16px;
    padding: 20px 22px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.gp-result-page-main-price span {
    font-size: 13px;
    font-weight: 700;
    opacity: .92;
}

.gp-result-page-main-price strong {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -.5px;
}

.gp-result-page-sub-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.gp-result-page-sub-box {
    background: #fff8f0;
    border: 1px solid #ffe1c2;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-result-page-sub-box span {
    font-size: 12.5px;
    font-weight: 700;
    color: #9a4a00;
    line-height: 1.4;
}

.gp-result-page-sub-box strong {
    font-size: 19px;
    font-weight: 900;
    color: #111;
}

.gp-result-page-summary {
    background: #fafafa;
    border-left: 4px solid #ff7a00;
    border-radius: 0 12px 12px 0;
    padding: 14px 16px;
    font-size: 14px;
    color: #444;
    line-height: 1.65;
    margin-bottom: 18px;
}

.gp-result-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.gp-thamani-path {
    flex: 1 1 30%;
    min-width: 150px;
    background: #fff;
    border: 2px solid #ff7a00;
    color: #ff7a00;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: center;
}

.gp-thamani-path:hover,
.gp-thamani-path.is-selected {
    background: #ff7a00;
    color: #fff;
}

/* "Tafuta Gari GariPesa" is an <a> link, not a <button>. Match button layout. */
a.gp-thamani-path,
.gp-thamani-browse-link {
    display: block;
    text-decoration: none;
    box-sizing: border-box;
}
a.gp-thamani-path:hover,
.gp-thamani-browse-link:hover {
    color: #fff;
    text-decoration: none;
}

.gp-result-page-footer {
    margin: 0;
    text-align: center;
    font-size: 12.5px;
    color: #aaa;
}

.gp-result-notice {
    margin: 0;
    padding: 16px;
    background: #fff8f0;
    border: 1px solid #ffe1c2;
    border-radius: 12px;
    color: #9a4a00;
    font-weight: 700;
    line-height: 1.55;
}

.gp-result-notice--error {
    background: #fff0f0;
    border-color: #ffc4c4;
    color: #b00020;
}

/* ── Share row ── */

.gp-thamani-share-wrap { margin-bottom: 18px; }

.gp-thamani-share-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    color: #555;
}

.gp-thamani-share-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gp-thamani-share-input {
    flex: 1 1 200px;
    padding: 11px 12px;
    border: 1.5px solid #e3e3e3;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
    background: #fafafa;
    outline: none;
    min-width: 0;
}

.gp-thamani-copy-btn,
.gp-thamani-share-btn {
    background: #fff;
    border: 2px solid #ff7a00;
    color: #ff7a00;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.gp-thamani-copy-btn:hover,
.gp-thamani-share-btn:hover,
.gp-thamani-copy-btn.is-copied {
    background: #ff7a00;
    color: #fff;
}

/* ── Pathway modal ── */

.gp-pathway-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gp-pathway-modal.is-open { display: flex; }

.gp-pathway-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.gp-pathway-dialog {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 26px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.gp-pathway-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.gp-pathway-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.gp-pathway-icon { font-size: 34px; line-height: 1; }

.gp-pathway-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: #111;
}

#gp-pathway-body {
    margin: 0 0 18px;
    font-size: 14.5px;
    color: #444;
    line-height: 1.65;
}

.gp-pathway-cta {
    display: block;
    text-align: center;
    background: #ff7a00;
    color: #fff !important;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none !important;
    transition: background .15s;
}

.gp-pathway-cta:hover { background: #e96f00; }

/* ── Mobile ── */

@media (max-width: 680px) {
    .gp-thamani-card,
    .gp-result-page-card { padding: 22px 16px; }

    .gp-thamani-intent-grid { grid-template-columns: 1fr; }

    .gp-thamani-grid { grid-template-columns: 1fr; }

    .gp-result-page-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .gp-result-page-sub-prices { grid-template-columns: 1fr; }

    .gp-thamani-path { flex: 1 1 100%; }

    .gp-result-page-main-price strong { font-size: 26px; }
}

/* ── Buyer popup (single car-listing pages) ──────────────────────────────────
   Structural rules only — form fields, buttons and the OTP dialog reuse the
   existing .gp-thamani-grid / .gp-thamani-btn / .gp-thamani-otp-* classes
   above so the popup matches the main calculator's look automatically. */

.gp-buyer-popup-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gp-buyer-popup-modal.is-open { display: flex; }

.gp-buyer-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.gp-buyer-popup-dialog {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 26px 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.gp-buyer-popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

#gp-buyer-popup-title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 900;
    color: #111;
    padding-right: 20px;
}

.gp-buyer-popup-note {
    margin: 0 0 18px;
    font-size: 13.5px;
    color: #555;
    line-height: 1.6;
    background: #fff8f0;
    border: 1px solid #ffe1c2;
    border-radius: 12px;
    padding: 12px 14px;
}

.gp-buyer-popup-note strong { color: #9a4a00; }

.gp-buyer-popup-actions { margin-top: 20px; }

.gp-buyer-popup-actions .gp-thamani-btn { width: 100%; }

/* Mkoa is the 3rd (odd) field in this popup stage's 2-col grid — spans the
   full row and centers itself instead of sitting left-aligned with an
   empty gap beside it. */
.gp-buyer-popup-mkoa-label {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
}

.gp-buyer-popup-mkoa-label select {
    width: 100%;
    max-width: 280px;
}

#gp-buyer-popup-error:empty { display: none; }

#gp-buyer-popup-error {
    background: #fff0f0;
    border: 1px solid #ffc4c4;
    color: #b00020;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.5;
}

@media (max-width: 680px) {
    .gp-buyer-popup-dialog { padding: 22px 18px; }
}