/* ──────────────────────────────────────────────────────────────────────────
   E-way Bill & GST Checker — Trade Tools
   Same visual family as Tools 1-5: amber accent, glass cards, gradient primary
   CTA, emerald copy button. The verdict uses amber for "required" rather than
   red — needing an e-way bill is a fact to act on, not an error.
   Mobile-first.
   ────────────────────────────────────────────────────────────────────────── */

/* Segmented buttons: language / GST rate ---------------------------------- */
.ewb-lang-btn,
.ewb-rate-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.10);
    color: #52525b;
    -webkit-tap-highlight-color: transparent;
}

html.dark .ewb-lang-btn,
html.dark .ewb-rate-btn {
    background: rgba(24, 24, 27, 0.8);
    border-color: rgba(255, 255, 255, 0.10);
    color: #a1a1aa;
}

.ewb-lang-btn:hover,
.ewb-rate-btn:hover {
    border-color: rgba(245, 158, 11, 0.45);
    color: #b45309;
}

html.dark .ewb-lang-btn:hover,
html.dark .ewb-rate-btn:hover {
    color: #fbbf24;
}

.ewb-lang-btn.is-active,
.ewb-rate-btn.is-active {
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 6px 18px -8px rgba(244, 63, 94, 0.65);
}

.ewb-lang-btn.is-active {
    /* The language chips sit inside a tinted track, so they stay flat. */
    background: #f59e0b;
    box-shadow: none;
}

/* The verdict ------------------------------------------------------------
   Three states, deliberately none of them red:
     required     — amber, a fact to act on, not an error
     not required — emerald
     depends      — blue, the honest answer when the state limit is unknown

   The html:not(.dark) / html.dark prefixes are load-bearing throughout this
   file: app.css rewrites [class*="bg-emerald-500/"] and friends to solid
   colours in light mode with !important, and unprefixed rules lose to that. */
.ewb-verdict {
    border: 1px solid transparent;
}

html:not(.dark) .ewb-verdict.is-required {
    background: #fffbeb;
    border-color: #fcd34d;
}

html:not(.dark) .ewb-verdict.is-required .ewb-verdict-title,
html:not(.dark) .ewb-verdict.is-required .ewb-verdict-icon {
    color: #b45309;
}

html:not(.dark) .ewb-verdict.is-required .ewb-verdict-detail {
    color: #92400e;
}

html.dark .ewb-verdict.is-required {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

html.dark .ewb-verdict.is-required .ewb-verdict-title,
html.dark .ewb-verdict.is-required .ewb-verdict-icon {
    color: #fbbf24;
}

html.dark .ewb-verdict.is-required .ewb-verdict-detail {
    color: #fcd34d;
}

html:not(.dark) .ewb-verdict.is-not-required {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

html:not(.dark) .ewb-verdict.is-not-required .ewb-verdict-title,
html:not(.dark) .ewb-verdict.is-not-required .ewb-verdict-icon {
    color: #047857;
}

html:not(.dark) .ewb-verdict.is-not-required .ewb-verdict-detail {
    color: #065f46;
}

html.dark .ewb-verdict.is-not-required {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

html.dark .ewb-verdict.is-not-required .ewb-verdict-title,
html.dark .ewb-verdict.is-not-required .ewb-verdict-icon {
    color: #6ee7b7;
}

html.dark .ewb-verdict.is-not-required .ewb-verdict-detail {
    color: #a7f3d0;
}

html:not(.dark) .ewb-verdict.is-depends {
    background: #eff6ff;
    border-color: #bfdbfe;
}

html:not(.dark) .ewb-verdict.is-depends .ewb-verdict-title,
html:not(.dark) .ewb-verdict.is-depends .ewb-verdict-icon {
    color: #1d4ed8;
}

html:not(.dark) .ewb-verdict.is-depends .ewb-verdict-detail {
    color: #1e40af;
}

html.dark .ewb-verdict.is-depends {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

html.dark .ewb-verdict.is-depends .ewb-verdict-title,
html.dark .ewb-verdict.is-depends .ewb-verdict-icon {
    color: #93c5fd;
}

html.dark .ewb-verdict.is-depends .ewb-verdict-detail {
    color: #bfdbfe;
}

/* Light-mode label colours on the saturated action buttons -----------------
   app.css rewrites `text-white` to a dark colour inside glass cards in light
   mode (its FAQ-accordion fix). These buttons sit on a gradient, a solid
   emerald fill and a solid dark fill, where a dark label is unreadable. */
html:not(.dark) #ewb-review-btn,
html:not(.dark) #ewb-review-btn span,
html:not(.dark) #ewb-review-btn i,
html:not(.dark) #ewb-copy-btn,
html:not(.dark) #ewb-copy-btn span,
html:not(.dark) #ewb-copy-btn i,
html:not(.dark) #ewb-download-btn,
html:not(.dark) #ewb-download-btn span,
html:not(.dark) #ewb-download-btn i {
    color: #ffffff !important;
}

html:not(.dark) #ewb-download-btn {
    background-color: #18181b !important;
}

/* Focus visibility for keyboard users ------------------------------------- */
.ewb-lang-btn:focus-visible,
.ewb-rate-btn:focus-visible,
#ewb-swap:focus-visible,
#ewb-portal-link:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Disabled "Check & Share" state (no value entered yet) ------------------- */
#ewb-review-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

/* Trade-style figures read better without desktop spinner arrows. */
.ewb-num::-webkit-outer-spin-button,
.ewb-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ewb-num {
    -moz-appearance: textfield;
    appearance: textfield;
}

#ewb-out-total,
#ewb-out-cgst,
#ewb-out-sgst,
#ewb-out-igst {
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* The review panel is the confirm-before-send gate — make its arrival
   noticeable without being loud. */
#ewb-review-panel:not([hidden]) {
    animation: ewb-review-in 0.22s ease-out;
}

@keyframes ewb-review-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    #ewb-review-panel:not([hidden]) { animation: none; }
}

/* Narrow phones: five rate chips in a row need to stay tappable. */
@media (max-width: 400px) {
    .ewb-rate-btn {
        font-size: 12px;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}
