/* Tribut — Custom styles */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Amount Display Effects ===== */

@keyframes amountBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

#amount-display.bounce {
    animation: amountBounce 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Preset Button Effects ===== */

.preset-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
}

.preset-active {
    box-shadow: 0 0 24px var(--accent-glow);
}

/* ===== Focus Visible ===== */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Scrollbar ===== */

textarea::-webkit-scrollbar {
    width: 4px;
}
textarea::-webkit-scrollbar-track {
    background: transparent;
}
textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ===== Number Input ===== */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Loading Spinner Pulse Ring ===== */

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 20px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

[data-step="3"]:not(.hidden) .inline-flex {
    animation: pulseRing 2s ease-out infinite;
}

/* ===== Success Page Animations ===== */

/* Checkmark container */
.success-check-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    opacity: 0;
    animation: successScaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.1s;
}

/* Pulsing glow ring behind checkmark */
.success-glow-ring {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow, rgba(168,85,247,0.35)) 0%, transparent 70%);
    animation: successGlow 2.5s ease-in-out infinite;
    animation-delay: 1s;
    opacity: 0;
}

/* Expanding ring burst on completion */
.success-ring-burst {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent, #a855f7);
    opacity: 0;
    animation: ringBurst 0.8s ease-out 0.9s forwards;
}

/* SVG circle draws itself — circumference of r=44 is ~276.5 */
.success-circle {
    stroke-dasharray: 276.5;
    stroke-dashoffset: 276.5;
    animation: successCircleDraw 0.7s ease-out 0.25s forwards;
}

/* SVG checkmark draws itself — path length ~55 */
.success-check {
    stroke-dasharray: 55;
    stroke-dashoffset: 55;
    animation: checkDraw 0.45s ease-out 0.85s forwards;
}

/* Amount reveal with scale spring */
.success-amount {
    position: relative;
    opacity: 0;
    transform: scale(0.5) translateY(8px);
    animation: amountReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    margin-bottom: 2rem;
    overflow: hidden;
}

.success-amount-value {
    font-size: 3.5rem;
    line-height: 1.1;
    display: inline-block;
}

/* Shimmer sweep over the amount */
.success-amount-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.15) 45%,
        rgba(255,255,255,0.25) 50%,
        rgba(255,255,255,0.15) 55%,
        transparent 70%
    );
    animation: shimmerSweep 1.2s ease-in-out 1.3s forwards;
    transform: translateX(-100%);
    pointer-events: none;
}

/* Generic staggered fade-in */
.success-fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: successFadeIn 0.6s ease-out forwards;
}

/* === Keyframes === */

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes successCircleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes successScaleIn {
    0% { opacity: 0; transform: scale(0.3); }
    60% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes successGlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes ringBurst {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.8); }
}

@keyframes amountReveal {
    0% { opacity: 0; transform: scale(0.5) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes successFadeIn {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes shimmerSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== Select Option Styling (dark bg) ===== */

select option {
    background-color: #1e1e38;
    color: white;
}
