:root {
    /* Tema Claro (Default) */
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #212529;
    --muted: #6c757d;
    --primary: #0d6efd;
    --secondary: #6c757d;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover: #f1f3f5;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
}

.theme-dark {
    /* Tema Escuro */
    --bg: #121212;
    --card: #1e1e1e;
    --text: #f8f9fa;
    --muted: #adb5bd;
    --primary: #0d6efd;
    --secondary: #6c757d;
    --border: #2d3436;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover: #2d3436;
    --success: #20c997;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* Configurações Gerais */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: var(--card) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 0;
}

.navbar-brand img {
    max-height: 40px;
}

.nav-link {
    color: var(--text) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: var(--hover);
    color: var(--primary) !important;
}

.navbar-right-buttons .btn {
    margin-left: 0.5rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: white;
}

.btn-login {
    background-color: var(--primary);
    color: white;
    border: none;
}

.btn-login:hover {
    background-color: #0b5ed7;
    color: white;
}

/* Toggle de Tema */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background-color: var(--hover);
}

/* Seção de Conversão */
.trade-section {
    padding: 100px 20px 80px;
    margin-top: 50px;
    display: flex;
    justify-content: center;
    flex: 1;
}

.trade-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
}

/* Tabs */
.trade-float-tabs {
    position: absolute;
    top: -26px;
    left: 40%;
    transform: translateX(-30%);
    display: flex;
    gap: 8px;
    z-index: 10;
    background: var(--card);
    padding: 4px;
    border-radius: 50px;
    box-shadow: 0 4px 12px var(--shadow);
}

.trade-tab {
    padding: 10px 28px;
    border-radius: 50px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.trade-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Card de Conversão */
.trade-card {
    background: var(--card);
    border-radius: 24px;
    padding: 40px 28px 32px;
    box-shadow: 0 20px 60px var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Grupos de Input */
.trade-group {
    margin-bottom: 24px;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.trade-input {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 16px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.trade-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.trade-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 24px;
    font-weight: 600;
    text-align: right;
    min-width: 0;
}

.trade-input input:focus {
    outline: none;
}

.currency {
    font-weight: 600;
    color: var(--text);
    font-size: 18px;
    min-width: 60px;
}

/* Seta */
.trade-arrow {
    text-align: center;
    margin: 20px 0;
    color: var(--primary);
    font-size: 24px;
}

/* Taxa */
.trade-fee {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin: 20px 0;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

/* Botões de Ação */
.trade-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-outline {
    flex: 1;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--hover);
}

.btn-main {
    flex: 1;
    background: var(--primary);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-main:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
}

/* Footer */
footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-bottom {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* Step 2 - Seleção de Rede */
.network-selection {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.network-options {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.network-option {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.network-option:hover {
    border-color: var(--primary);
    background: var(--hover);
}

.network-option.selected {
    border-color: var(--primary);
    background: rgba(13, 110, 253, 0.1);
}

.network-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    color: white;
}

.network-icon.onchain {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.network-icon.lightning {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.network-icon.liquid {
    background: linear-gradient(135deg, #10b981, #059669);
}

.network-info h6 {
    margin: 0;
    font-weight: 600;
}

.network-info small {
    color: var(--muted);
    font-size: 12px;
}

/* Wallet Input */
.wallet-input-group {
    margin: 20px 0;
}

.wallet-input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
}

.wallet-input {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px !important;
    width: 100% !important;
    color: var(--text);
    font-family: monospace;
    font-size: 14px;
    transition: all 0.3s;
    display: block;
    box-sizing: border-box;
}

.wallet-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.wallet-input.valid {
    border-color: var(--success);
}

.wallet-input.invalid {
    border-color: var(--danger);
}

.validation-message {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validation-message.valid {
    color: var(--success);
}

.validation-message.invalid {
    color: var(--danger);
}
/* Botões de Navegação */
.step-navigation {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-back {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0.3;
}

.btn-back:hover {
    border-color: var(--primary);
    background: var(--hover);
}

.btn-next {
    background: var(--primary);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0.7;
}

.btn-next:hover {
    background: #0b5ed7;
}

.btn-next:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    border: 2px solid var(--bg);
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* Overlay de Loading */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 24px;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .trade-section {
        padding: 80px 15px 60px;
    }

    .trade-card {
        padding: 30px 20px;
    }

    .trade-float-tabs {
        top: -20px;
    }

    .trade-tab {
        padding: 8px 20px;
        font-size: 14px;
    }

    .trade-input input {
        font-size: 20px;
    }

    .trade-actions {
        flex-direction: column;
    }

    .step-navigation {
        flex-direction: column;
    }

    .btn-back,
    .btn-next {
        width: 100%;
        flex: 1;
    }
}

/* Estilo para o modo escuro específico */
.theme-dark .trade-input {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .trade-fee {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .network-option {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .wallet-input {
    background: rgba(255, 255, 255, 0.05);
}


/* ============================
   ESTILOS PARA O FORMULÁRIO
   ============================ */

/* Inputs de conversão */
.trade-input {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 16px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    transition: all 0.3s;
    margin-bottom: 15px;
}

.trade-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.trade-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 24px;
    font-weight: 600;
    text-align: right;
    min-width: 0;
    width: 100%;
}

.trade-input input:focus {
    outline: none;
}

.trade-input input[readonly] {
    background: rgba(0,0,0,0.05);
    color: var(--muted);
}

.currency {
    font-weight: 600;
    color: var(--text);
    font-size: 18px;
    min-width: 60px;
}

/* Informações da cotação */
.exchange-rate-info {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 4px solid var(--primary);
}

.exchange-rate-info .rate-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1em;
}

.exchange-rate-info .rate-change {
    font-size: 0.9em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(25, 135, 84, 0.1);
}

.exchange-rate-info .rate-change.negative {
    background: rgba(220, 53, 69, 0.1);
}

/* Wallet validation styles */
.wallet-input-group {
    margin: 25px 0;
}

.wallet-input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--muted);
}

.wallet-input {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    width: 100%;
    color: var(--text);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.wallet-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.wallet-input.valid {
    border-color: var(--success);
    background: rgba(25, 135, 84, 0.05);
}

.wallet-input.invalid {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.05);
}

.validation-message {
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.validation-message.valid {
    color: var(--success);
}

.validation-message.invalid {
    color: var(--danger);
}

.validation-message i {
    font-size: 14px;
}

/* Taxa de serviço destacada */
.fee-highlight {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.fee-highlight .fee-percentage {
    font-weight: 700;
    color: var(--warning);
    font-size: 1.2em;
}

/* Botão de atualização de cotação */
.refresh-rate-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s;
    margin-left: 8px;
}

.refresh-rate-btn:hover {
    background: var(--hover);
}

.refresh-rate-btn.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Indicador de carregamento */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 24px;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tema escuro específico */
.theme-dark .trade-input {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .wallet-input {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .exchange-rate-info {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .fee-highlight {
    background: rgba(255, 193, 7, 0.05);
}