/* Jhatpat Cash chatbot widget — plain-CSS port of the React ChatBot used on the
   other brand sites. Everything is scoped under #fsc-root / .fsc-* so it can't
   clash with the site CSS. Sits above the 44px fraud ticker. Brand colours:
   --fsc-navy = logo navy, --fsc-red = logo orange (names kept from the port). */

#fsc-root {
    --fsc-navy: #092F5E;
    --fsc-red: #EE831E;
    --fsc-peach: #FFF1E3;
    --fsc-text: #1F2937;
    --fsc-muted: #6B7280;
    position: fixed;
    right: 20px;
    bottom: 56px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

#fsc-root *,
#fsc-root *::before,
#fsc-root *::after {
    box-sizing: border-box;
}

#fsc-root button,
#fsc-root input {
    font-family: inherit;
}

#fsc-root [hidden] {
    display: none !important;
}

/* ── Toggle button ─────────────────────────────────────────── */
.fsc-toggle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--fsc-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.fsc-toggle:hover {
    transform: scale(1.08);
}

.fsc-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.fsc-toggle svg {
    width: 26px;
    height: 26px;
}

/* ── Chat window ───────────────────────────────────────────── */
.fsc-window {
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid #F3F4F6;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    /* phones: fill the screen above the toggle button */
    position: fixed;
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: 150px;
}

.fsc-window.fsc-open {
    display: flex;
    animation: fsc-window-in 0.25s ease-out;
}

@media (min-width: 768px) {
    .fsc-window {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: 380px;
        height: 600px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 210px);
        margin-bottom: 16px;
    }
}

@keyframes fsc-window-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.fsc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #F3F4F6;
    flex-shrink: 0;
}

.fsc-header img {
    height: 36px;
    width: auto;
    max-width: 75%;
    object-fit: contain;
    object-position: left;
}

.fsc-icon-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.fsc-icon-btn:hover {
    color: #4B5563;
}

.fsc-icon-btn svg {
    width: 22px;
    height: 22px;
}

.fsc-body {
    flex: 1;
    overflow-y: auto;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
}

.fsc-chat-view {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* hero */
.fsc-hero-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--fsc-navy);
    margin: 0;
}

.fsc-hero-brand span {
    color: var(--fsc-red);
}

.fsc-hero-hello {
    font-size: 28px;
    font-weight: 700;
    color: var(--fsc-text);
    margin: 8px 0 0;
    line-height: 1.2;
}

.fsc-hero-sub {
    font-size: 14px;
    color: var(--fsc-muted);
    margin: 12px 0 0;
    line-height: 1.55;
}

/* quick actions */
.fsc-quick {
    background: var(--fsc-navy);
    padding: 18px 12px;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.fsc-quick p {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 14px;
}

.fsc-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.fsc-quick-btn {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: var(--fsc-red);
}

.fsc-quick-btn:hover {
    transform: scale(1.05);
}

.fsc-quick-btn svg {
    width: 22px;
    height: 22px;
}

.fsc-quick-btn span {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
}

/* messages */
.fsc-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fsc-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fsc-pop 0.3s ease-out;
}

.fsc-row.fsc-user {
    flex-direction: row-reverse;
}

@keyframes fsc-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fsc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--fsc-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.fsc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fsc-avatar.fsc-avatar-user {
    background: #1F2937;
}

.fsc-avatar svg {
    width: 16px;
    height: 16px;
}

.fsc-bubble {
    background: #fff;
    color: #374151;
    padding: 14px 18px;
    border-radius: 22px;
    border-top-left-radius: 4px;
    font-size: 14px;
    line-height: 1.55;
    max-width: 85%;
    border: 1px solid #F9FAFB;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow-wrap: anywhere;
}

.fsc-user .fsc-bubble {
    color: var(--fsc-text);
    border-top-left-radius: 22px;
    border-top-right-radius: 4px;
}

.fsc-bubble strong {
    font-weight: 700;
    color: #111827;
}

.fsc-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 9px;
    font-weight: 700;
    color: #D1D5DB;
    text-transform: uppercase;
}

.fsc-user .fsc-time {
    justify-content: flex-end;
}

.fsc-ticks {
    color: var(--fsc-red);
    opacity: 0.7;
    font-style: italic;
    font-size: 8px;
}

/* related question chips */
.fsc-chips {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fsc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    color: #4B5563;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.fsc-chip:hover {
    background: var(--fsc-red);
    border-color: var(--fsc-red);
    color: #fff;
}

.fsc-chip svg {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
}

/* apply button */
.fsc-apply-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: center;
}

.fsc-apply {
    display: inline-block;
    background: var(--fsc-red);
    color: #fff !important;
    text-decoration: none;
    padding: 10px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
    text-align: center;
}

.fsc-apply:hover {
    transform: scale(1.04);
}

.fsc-apply.fsc-block {
    display: block;
    width: 100%;
}

/* special cards (loan status / EMI result / loan journey) */
.fsc-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 200px;
}

.fsc-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.fsc-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--fsc-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fsc-card-icon svg {
    width: 16px;
    height: 16px;
}

.fsc-card-title {
    font-weight: 700;
    color: var(--fsc-text);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: -0.01em;
}

.fsc-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 8px;
}

.fsc-label {
    display: block;
    font-size: 10px;
    color: #9CA3AF;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fsc-value {
    font-weight: 700;
    color: #374151;
}

.fsc-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.fsc-right {
    text-align: right;
}

.fsc-span2 {
    grid-column: span 2;
}

.fsc-status {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: #DBEAFE;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

.fsc-status.fsc-ok { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }
.fsc-status.fsc-bad { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.fsc-status.fsc-wait { background: #FEF9C3; color: #A16207; border-color: #FEF08A; }

.fsc-tile {
    background: #F9FAFB;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #F3F4F6;
}

.fsc-tile .fsc-label {
    font-size: 9px;
    margin-bottom: 2px;
}

.fsc-sum {
    padding: 12px;
    background: #F9FAFB;
    border-radius: 12px;
    font-size: 12px;
}

.fsc-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--fsc-muted);
}

.fsc-sum-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.fsc-sum-total span:first-child {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #4B5563;
}

.fsc-sum-total span:last-child {
    font-size: 20px;
    font-weight: 700;
    color: var(--fsc-red);
}

.fsc-note {
    font-size: 10px;
    color: #9CA3AF;
    text-align: center;
    font-style: italic;
    margin: 4px 0 8px;
}

.fsc-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 4px;
}

.fsc-step {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #4B5563;
    font-weight: 500;
}

.fsc-step b {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--fsc-muted);
    flex-shrink: 0;
}

/* thinking indicator */
.fsc-thinking {
    font-size: 10px;
    font-weight: 900;
    color: var(--fsc-red);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-style: italic;
    animation: fsc-pulse 2s ease-in-out infinite;
}

@keyframes fsc-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* footer input */
.fsc-footer {
    padding: 12px 16px;
    background: var(--fsc-navy);
    flex-shrink: 0;
}

.fsc-input-wrap {
    background: #fff;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 6px 6px 6px 20px;
}

.fsc-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    padding: 8px 8px 8px 0;
    color: #374151;
}

.fsc-send {
    background: var(--fsc-red);
    color: #fff;
    width: 72px;
    height: 40px;
    border: none;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.2s;
}

.fsc-send:hover {
    filter: brightness(1.1);
}

.fsc-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fsc-send svg {
    width: 20px;
    height: 20px;
}

.fsc-disclaimer {
    margin: 8px 0 0;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ── EMI calculator view ───────────────────────────────────── */
.fsc-calc {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.fsc-calc-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
}

.fsc-back {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #F9FAFB;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fsc-back:hover {
    background: #F3F4F6;
    color: var(--fsc-red);
}

.fsc-back svg {
    width: 16px;
    height: 16px;
}

.fsc-calc-tag {
    font-size: 10px;
    font-weight: 900;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.5;
}

.fsc-calc-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fsc-slider-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--fsc-text);
}

.fsc-slider-top span:last-child {
    color: var(--fsc-red);
}

.fsc-slider-top svg {
    width: 14px;
    height: 14px;
    color: var(--fsc-red);
    margin-right: 6px;
    vertical-align: -2px;
}

.fsc-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    cursor: pointer;
    outline: none;
}

.fsc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--fsc-red);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.fsc-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--fsc-red);
    border: none;
}

.fsc-slider-ends {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #787878;
    margin-top: 6px;
}

.fsc-result {
    background: var(--fsc-navy);
    color: #fff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.fsc-result-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 700;
}

.fsc-result-total span:first-child {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.fsc-result-total span:last-child {
    font-size: 34px;
    font-weight: 900;
    padding: 6px 0;
}

.fsc-result-row {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    margin-top: 12px;
}

.fsc-result-apply {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    color: var(--fsc-navy) !important;
    text-decoration: none;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
}

.fsc-result-apply:hover {
    transform: translateY(-2px);
}

.fsc-result-apply svg {
    width: 16px;
    height: 16px;
}

/* ── Nudge pop-ups ─────────────────────────────────────────── */
.fsc-nudge-slot {
    position: relative;
    width: 260px;
    max-width: calc(100vw - 40px);
    margin: 0 4px 12px 0;
    display: flex;
    justify-content: flex-end;
}

.fsc-nudge {
    position: relative;
    text-align: left;
    cursor: pointer;
    border: 1px solid #F3F4F6;
    background: #fff;
    color: var(--fsc-text);
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    padding: 10px 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    animation: fsc-nudge-in 0.25s ease-out;
    transition: transform 0.2s;
}

.fsc-nudge:hover {
    transform: scale(1.03);
}

@keyframes fsc-nudge-in {
    from { opacity: 0; transform: translateY(10px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fsc-nudge b {
    font-size: 14px;
    font-weight: 700;
}

.fsc-nudge small {
    font-size: 12px;
    color: var(--fsc-muted);
}

.fsc-nudge.fsc-stripe {
    border-left: 4px solid var(--fsc-red);
    border-radius: 12px;
}

.fsc-nudge.fsc-pill {
    border: 2px solid var(--fsc-red);
    border-radius: 999px;
    color: var(--fsc-red);
    padding: 8px 18px;
}

.fsc-nudge.fsc-solid {
    background: var(--fsc-red);
    border-color: var(--fsc-red);
    color: #fff;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.fsc-nudge.fsc-solid small {
    color: rgba(255, 255, 255, 0.85);
}

.fsc-nudge-col {
    display: flex;
    flex-direction: column;
}

.fsc-nudge-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fsc-nudge-arrow svg {
    width: 12px;
    height: 12px;
}

.fsc-nudge-online {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.fsc-dot {
    position: relative;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.fsc-dot::before,
.fsc-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22C55E;
}

.fsc-dot::before {
    background: #4ADE80;
    animation: fsc-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes fsc-ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}

.fsc-tag {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--fsc-navy);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.fsc-nudge-x {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    color: #6B7280;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fsc-nudge-x:hover {
    color: #1F2937;
}

.fsc-nudge-x svg {
    width: 9px;
    height: 9px;
}

@media (prefers-reduced-motion: reduce) {
    #fsc-root *,
    #fsc-root *::before,
    #fsc-root *::after {
        animation: none !important;
        transition: none !important;
    }
}
