/* ==========================================================================
   Buy Me a Coffee — single screen, orange + white
   Animations stick to transform/opacity so nothing repaints per frame.
   ========================================================================== */

:root {
    --orange: #F97316;
    --orange-light: #FB923C;
    --orange-deep: #EA580C;
    --cream: #FFF7ED;
    --white: #FFFFFF;
    --text: #1F2937;
    --muted: #6B7280;
    --line: rgba(249, 115, 22, .22);

    --grad: linear-gradient(135deg, #FB923C 0%, #F97316 52%, #EA580C 100%);
    --shadow: 0 2px 6px rgba(234, 88, 12, .06), 0 18px 40px -18px rgba(234, 88, 12, .35);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-back: cubic-bezier(.34, 1.56, .64, 1);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            "Noto Sans", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--cream);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

h1, p { margin: 0; }

button {
    font: inherit;
    color: inherit;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 3px; }

/* ------------------------------------------------------- soft orange glow */
.glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(46% 34% at 12% 4%,  rgba(251, 146, 60, .34), transparent 70%),
        radial-gradient(42% 32% at 92% 12%, rgba(249, 115, 22, .26), transparent 72%),
        radial-gradient(60% 42% at 50% 104%, rgba(254, 215, 170, .55), transparent 72%);
    animation: breathe 12s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes breathe {
    from { transform: scale(1) translate3d(0, 0, 0); }
    to   { transform: scale(1.08) translate3d(0, -2%, 0); }
}

/* ================================================================== layout */
.wrap {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.card {
    width: 100%;
    max-width: 400px;
    padding: 26px 22px 22px;
    border-radius: 26px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
    animation: rise .6s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.no-js .card { animation: none; }

/* ==================================================================== cup */
.cup {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 12px;
    border-radius: 22px;
    background: linear-gradient(140deg, #FFEDD5, #FFF7ED);
    border: 1px solid var(--line);
}

.cup__emoji {
    font-size: 34px;
    line-height: 1;
    animation: float 4.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes float {
    0%, 100% { transform: translate3d(0, -2px, 0) rotate(-5deg); }
    50%      { transform: translate3d(0, 2px, 0) rotate(5deg); }
}

.cup__steam {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 34px;
    height: 20px;
    margin-left: -17px;
}
.cup__steam i {
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(to top, rgba(249, 115, 22, 0), rgba(249, 115, 22, .5));
    opacity: 0;
    animation: steam 3.4s ease-in-out infinite;
    will-change: transform, opacity;
}
.cup__steam i:nth-child(1) { left: 4px;  animation-delay: 0s; }
.cup__steam i:nth-child(2) { left: 15px; animation-delay: 1.1s; }
.cup__steam i:nth-child(3) { left: 26px; animation-delay: 2.2s; }

@keyframes steam {
    0%   { opacity: 0; transform: translate3d(0, 4px, 0) scale(.7); }
    30%  { opacity: .85; }
    100% { opacity: 0; transform: translate3d(-3px, -16px, 0) scale(1.2); }
}

/* ================================================================== copy */
.title {
    font-size: clamp(1.65rem, 7.6vw, 2.1rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.035em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    margin-top: 8px;
    color: var(--muted);
    font-size: .92rem;
    max-width: 30ch;
    margin-inline: auto;
}

.warn {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #FFFBEB;
    border: 1px solid rgba(217, 119, 6, .3);
    color: #92400E;
    font-size: .82rem;
}
.warn code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(146, 64, 14, .1);
    font-size: .9em;
}

/* ================================================= amount input (primary) */
.label {
    display: block;
    margin: 22px 0 8px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.field {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    border-radius: 18px;
    background: var(--cream);
    border: 2px solid var(--line);
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.field:focus-within {
    background: var(--white);
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .18);
}
.field.is-bad {
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .14);
}

.field__rupee {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--orange);
    line-height: 1;
}

.field__input {
    flex: 1;
    min-width: 0;
    height: 64px;
    border: 0;
    outline: none;
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: left;
}
.field__input::placeholder { color: #D1D5DB; }

/* remove number-ish spinners if the input type is ever changed */
.field__input::-webkit-outer-spin-button,
.field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------- optional quick amounts */
.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    flex: 1 1 auto;
    min-width: 68px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--white);
    color: var(--orange-deep);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: transform .2s var(--ease-back), border-color .2s ease,
                background .2s ease, color .2s ease;
}
.chip:active { transform: scale(.94); }
.chip.is-on {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(234, 88, 12, .7);
}
@media (hover: hover) {
    .chip:hover { border-color: var(--orange-light); background: var(--cream); }
    .chip.is-on:hover { background: var(--grad); }
}

/* ================================================================== pay */
.pay {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    margin-top: 16px;
    padding: 0 18px;
    border-radius: 18px;
    background: var(--grad);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    overflow: hidden;
    box-shadow: 0 12px 26px -12px rgba(234, 88, 12, .8);
    transition: transform .2s var(--ease-back), opacity .25s ease,
                box-shadow .25s var(--ease), filter .25s ease;
}

.pay:disabled {
    cursor: not-allowed;
    filter: grayscale(.55);
    opacity: .5;
    box-shadow: none;
}

.pay:not(:disabled):active { transform: scale(.978); }
@media (hover: hover) {
    .pay:not(:disabled):hover {
        transform: translate3d(0, -2px, 0);
        box-shadow: 0 18px 34px -14px rgba(234, 88, 12, .85);
    }
}

/* shine sweep, only while the button is usable */
.pay__shine {
    position: absolute;
    top: -60%;
    left: -40%;
    width: 32%;
    height: 220%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
    transform: translate3d(-140%, 0, 0) rotate(14deg);
    will-change: transform;
}
.pay:not(:disabled) .pay__shine { animation: shine 4.6s ease-in-out infinite; }

@keyframes shine {
    0%, 60%   { transform: translate3d(-140%, 0, 0) rotate(14deg); }
    90%, 100% { transform: translate3d(430%, 0, 0) rotate(14deg); }
}

.note {
    margin-top: 12px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

/* ============================================================== UPI ID row */
.upi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px dashed var(--line);
    background: var(--cream);
    text-align: left;
    transition: border-color .2s ease, transform .2s var(--ease-back);
}
.upi:active { transform: scale(.98); }
@media (hover: hover) {
    .upi:hover { border-color: var(--orange-light); }
}

.upi__id {
    min-width: 0;
    color: var(--text);
    font-size: .86rem;
    font-weight: 700;
    word-break: break-all;
}

.upi__copy {
    flex: none;
    color: var(--orange-deep);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ================================================================= toasts */
.toasts {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 0;
    padding-top: max(14px, env(safe-area-inset-top));
    pointer-events: none;
}

.toast {
    max-width: 100%;
    padding: 11px 16px;
    border-radius: 999px;
    background: #1F2937;
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: 0 14px 30px -12px rgba(31, 41, 55, .6);
    opacity: 0;
    transform: translate3d(0, -16px, 0) scale(.95);
    transition: opacity .28s ease, transform .4s var(--ease-back);
    will-change: transform, opacity;
}
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translate3d(0, -12px, 0) scale(.97); }
.toast--ok { background: linear-gradient(120deg, #EA580C, #FB923C); }
.toast--bad { background: linear-gradient(120deg, #B91C1C, #EF4444); }

/* =============================================================== noscript */
.noscript {
    position: relative;
    z-index: 2;
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    text-align: center;
    font-size: .88rem;
}

/* ============================================================== responsive */
@media (min-width: 480px) {
    .card { max-width: 420px; padding: 32px 30px 26px; }
    .field__input, .field__rupee { font-size: 1.9rem; }
    .field__input { height: 68px; }
}

/* short screens: let it scroll rather than clip */
@media (max-height: 560px) {
    .wrap { align-content: start; }
    .cup { width: 56px; height: 56px; margin-bottom: 8px; }
    .cup__emoji { font-size: 28px; }
    .label { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .12s !important;
    }
    .cup__steam { display: none; }
}

/* pause animation work when the tab is in the background */
html.is-hidden *, html.is-hidden *::before, html.is-hidden *::after {
    animation-play-state: paused !important;
}
