/* ============================================
   Tauri Swap — Preto & Dourado
   ============================================ */

:root {
    --blue: #111827;
    --blue-hover: #000000;
    --blue-light: #b8860b;
    --blue-bg: #fdf8ef;
    --blue-glow: rgba(184, 134, 11, 0.18);
    --gold: #b8860b;
    --gold-light: #d4a017;
    --gold-bg: #fdf8ef;
    --gold-glow: rgba(184, 134, 11, 0.2);
    --red: #dc2626;
    --red-bg: #fef2f2;
    --amber: #d97706;
    --amber-bg: #fffbeb;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#app {
    width: 100%;
    max-width: 480px;
}

/* ======= Card ======= */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}

/* ======= Logo inside card ======= */
.card-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-logo img {
    height: 78px;
    display: inline-block;
}

.card-logo.sm { margin-bottom: 1.25rem; padding-bottom: 1rem; }
.card-logo.sm img { height: 30px; }

.card-logo-sub {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ======= Wizard Bar ======= */
.wizard-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.wz-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 56px;
}

.wz-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    color: var(--gray-400);
    transition: all 0.3s;
}

.wz-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--gray-400);
    transition: color 0.3s;
}

.wz-step.active .wz-num {
    background: var(--gold);
    border-color: var(--gold);
    color: white;
    box-shadow: 0 0 0 4px var(--gold-glow);
}

.wz-step.active .wz-label { color: var(--gold); }

.wz-step.done .wz-num {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: white;
}

.wz-step.done .wz-label { color: var(--gray-600); }

.wz-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 6px;
    margin-bottom: 18px;
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.wz-line-fill {
    height: 100%;
    width: 0%;
    background: var(--gray-900);
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* ======= Panels ======= */
.wz-panel {
    animation: panelIn 0.25s ease-out;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.15rem;
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* ======= Fields ======= */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}

.field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input,
.field select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-800);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.field input:focus,
.field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.field input::placeholder { color: var(--gray-400); }

.field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.25rem;
}

.field small {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.input-suffix {
    position: relative;
}

.input-suffix input { padding-right: 4rem; }

.input-suffix .suffix {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
    pointer-events: none;
}

.input-suffix .copy-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.35rem 0.75rem;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.input-suffix .copy-btn:hover { background: #000; }

.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem !important; }

/* ======= Buttons ======= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
}

.btn-blue {
    background: var(--gray-900);
    color: white;
}

.btn-blue:hover:not(:disabled) {
    background: #000;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-blue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-blue.loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn-outline {
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

.btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-row .btn { flex: 1; }

.w-full { width: 100%; }

/* ======= Quote Box ======= */
.quote-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 1.25rem;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.3rem 0;
    color: var(--gray-600);
}

.quote-row span:last-child { font-weight: 600; color: var(--gray-800); }

.quote-total {
    border-top: 1px solid var(--gray-200);
    margin-top: 0.4rem;
    padding-top: 0.6rem;
}

.quote-total span:first-child { font-weight: 600; color: var(--gray-800); }
.quote-total span:last-child { font-size: 1.1rem; }

/* ======= Summary ======= */
.summary-list {
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--gray-100);
}

.summary-row:last-child { border-bottom: none; }

.summary-row span:first-child { color: var(--gray-500); }
.summary-row span:last-child { font-weight: 600; color: var(--gray-800); }

.summary-total {
    border-top: 2px solid var(--gray-200);
    border-bottom: none;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.summary-total span:last-child { font-size: 1.2rem; }

/* ======= Error ======= */
.error-msg {
    background: var(--red-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ======= Alert ======= */
.alert {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
}

.alert-warn {
    background: var(--amber-bg);
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ======= Confirm Box (Step 3) ======= */
.confirm-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
}

.confirm-row:last-child { border-bottom: none; }

.confirm-label { color: var(--gray-500); }
.confirm-value { font-weight: 600; color: var(--gray-800); }

.confirm-highlight {
    border-top: 2px solid var(--gray-200);
    border-bottom: none;
    padding-top: 0.6rem;
    margin-top: 0.2rem;
}

.confirm-highlight .confirm-value { font-size: 1.1rem; }

.alert-info {
    background: #f0f4ff;
    border: 1px solid #c7d7fe;
    color: #3b4f7a;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* ======= Timer ======= */
.timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    color: var(--amber);
}

.timer-row #timer {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.2rem;
}

.timer-row small {
    color: var(--gray-400);
    font-size: 0.78rem;
}

/* ======= QR ======= */
.qr-wrap {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    width: fit-content;
    margin: 0 auto 1.5rem auto;
}

/* ======= Spinner ======= */
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 1.25rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ======= Processing Steps ======= */
.proc-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 220px;
    margin: 1.5rem auto 0 auto;
    text-align: left;
}

.proc-step {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--gray-400);
    font-size: 0.88rem;
    transition: color 0.3s;
}

.proc-step.active { color: var(--gray-800); font-weight: 500; }
.proc-step.done { color: var(--gold); }

.proc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
    transition: all 0.3s;
}

.proc-step.active .proc-dot {
    background: var(--amber);
    box-shadow: 0 0 6px rgba(217,119,6,0.4);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.proc-step.done .proc-dot {
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold-glow);
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* ======= Success Icon ======= */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gold-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: var(--gold);
}

/* ======= Screen Transition ======= */
.screen { animation: fadeIn 0.25s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======= Utilities ======= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-blue { color: var(--gold) !important; }
.text-red { color: var(--red) !important; }
.fw-700 { font-weight: 700 !important; }
.small { font-size: 0.75rem !important; }
.hidden { display: none !important; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ======= 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; }

/* ======= Toast ======= */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.25s ease-out, toastOut 0.25s ease-in 1.7s forwards;
    z-index: 50;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ======= Footer ======= */
.footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.72rem;
    color: var(--gray-400);
}

.footer strong { color: var(--gray-600); }

/* ======= Responsive ======= */
@media (max-width: 480px) {
    body { padding: 0.75rem; }
    .card { padding: 1.5rem; border-radius: 14px; }
    .card-logo img { height: 32px; }
}
