:root {
    --bg-main: #fffef2;
    --card-bg: #b9e2dc;
    --teal-main: #00BFA5;
    --text-dark: #333;
    --text-grey: #666;
    --text-light: #999;
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    display: flex;
    justify-content: center;
    color: var(--text-dark);
}

.app-shell {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    padding: 15px;
}

/* Modal de Segurança */
.overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#welcome-screen {
    background-image: url('assets/inicio.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    align-items: flex-end; /* Move o conteúdo para o final (baixo) */
    padding-bottom: 50px;
}

.welcome-modal-transparent {
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
}

.transparent-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 18px;
    width: 100%;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.transparent-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.98);
}

.pin-modal {
    max-width: 320px;
    padding: 30px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pin-field {
    width: 100%;
    height: 60px;
    background: #f4f7f6;
    border: 2px solid transparent;
    border-radius: 16px;
    text-align: center;
    font-size: 32px;
    letter-spacing: 15px;
    color: var(--dark-bg);
    outline: none;
    transition: all 0.3s;
    font-weight: 800;
    -webkit-text-security: disc; /* Força máscara em alguns navegadores */
}
.pin-field:focus {
    border-color: var(--teal-main);
    background: #fff;
    box-shadow: 0 0 15px rgba(0, 191, 165, 0.2);
}
#tx-pin-status {
    font-weight: 600;
    color: var(--text-grey);
}
.pin-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pin-icon {
    font-size: 52px;
    color: var(--teal-main);
    margin-bottom: 15px;
}

.pin-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.pin-header p {
    color: var(--text-grey);
    font-size: 14px;
    margin-bottom: 30px;
}

.pin-input-container {
    width: 100%;
}

.pin-input-container input {
    width: 100%;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 18px;
    font-size: 36px;
    text-align: center;
    letter-spacing: 15px;
    margin-bottom: 25px;
    outline: none;
    -webkit-text-security: disc;
}

.pin-input-container input:focus {
    border-color: var(--teal-main);
}

#pin-status {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

#pin-error {
    color: #ff4a4a;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Balance Card */
.balance-card {
    background-color: var(--card-bg);
    border-radius: 30px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 191, 165, 0.1);
}

.balance-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-grey);
    margin-bottom: 10px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.filter-tabs {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: #f1f5f9;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--teal-main);
    color: #fff;
}

.balance-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.arrow-icon {
    font-size: 24px;
    color: var(--text-grey);
    opacity: 0.5;
}

.tether-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
}

.tether-logo {
    width: 24px;
    height: 24px;
}

.tether-text {
    font-size: 22px;
    font-weight: 800;
    color: #00848e; /* Cor típica do logo tether */
    letter-spacing: -0.5px;
}

.tether-balance {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-left: 5px;
}

.rates-container {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 25px;
}

.rates-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-grey);
    margin-bottom: 8px;
}

.rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rate-item {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
}

.flags-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.flag-wrapper {
    width: 75px; /* Reduzido em ~20% em relação ao preenchimento total */
    cursor: pointer;
}

.flag-wrapper img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    display: block;
}

/* Actions Container */
.actions-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 40px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.action-circle {
    width: 75px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.action-circle:active {
    transform: scale(0.92);
}

.icon-action {
    width: 75px; /* Tamanho total do botão */
    height: 75px;
    display: block;
}

.icon-white {
    filter: brightness(0) invert(1);
}

.action-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
}

/* History Section */
.history-container {
    background-color: #f8fafc;
    border-radius: 35px 35px 0 0;
    padding: 30px 20px;
    min-height: 400px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.history-header {
    font-size: 13px;
    font-weight: 900;
    color: #6a8c88;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.transaction-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}
.transaction-card:active {
    transform: scale(0.98);
}

.tx-out {
    background: rgba(255, 74, 74, 0.06); /* Vermelho bem claro */
}

.tx-in {
    background: rgba(0, 191, 165, 0.06); /* Verde bem claro */
}

.tx-icon-box {
    width: 40px;
    height: 40px;
    background: transparent; /* Removido o branco para o ícone brilhar */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.tx-out .tx-icon-box {
    border-color: #ff4a4a;
}

.tx-in .tx-icon-box {
    border-color: var(--teal-main);
}

.tx-icon-img {
    width: 36px; /* Ocupando 90-95% do espaço */
    height: 36px;
    object-fit: contain;
}

.tx-details {
    flex: 1;
}

.tx-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.tx-subtitle {
    font-size: 11px;
    color: #777;
    font-weight: 500;
}

/* Modal de Comprovante Premium - Fix de Centralização */

.receipt-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%); /* Centralização absoluta infalível */
    background: #00796b;
    background: linear-gradient(135deg, #00bfa5 0%, #00796b 100%);
    width: 92%;
    max-width: 360px;
    border-radius: 28px;
    padding: 22px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 20px;
}

.close-receipt {
    background: rgba(0,0,0,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.receipt-success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.check-circle {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.check-circle svg {
    stroke: #00bfa5; /* Checkmark verde no fundo branco */
}

.receipt-amount-box {
    text-align: center;
    margin-bottom: 20px;
}

.receipt-amount-box h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 4px;
}

.receipt-amount-box p {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.receipt-details-table {
    background: rgba(0,0,0,0.15);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 20px;
}

.rec-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 12px;
}

.rec-row span {
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
    width: 90px;
}

.rec-row b {
    text-align: right;
    word-break: break-all;
    font-weight: 700;
    color: #fff;
}

.rec-row small {
    text-align: right;
    font-size: 10px;
    word-break: break-all;
    color: rgba(255,255,255,0.9);
}

.share-btn {
    width: 100%;
    background: #fff;
    border: none;
    color: #00796b;
    padding: 14px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.share-btn:active {
    transform: scale(0.98);
    background: #f8fafc;
}

/* Modais e Botões */
.primary-btn {
    background: var(--teal-main);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 18px;
    width: 100%;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 191, 165, 0.2);
}

/* Modais e Overlays Premium */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-start; /* Alinha ao topo para não sumir com teclado */
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    padding: 20px 15px;
    overflow-y: auto; /* Permite rolar se o teclado ocupar muito espaço */
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 380px;
    border-radius: 32px;
    padding: 25px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: none; /* Removido limite rígido para evitar squash */
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.rotating {
    animation: rotate 1.5s linear infinite;
    display: inline-block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
}

.close-modal {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-grey);
    cursor: pointer;
}

/* Campos de Entrada Modernos */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-grey);
    margin-bottom: 10px;
    padding-left: 5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 2px 18px;
    border: 2px solid #eee;
    transition: all 0.25s ease;
}

.input-wrapper:focus-within {
    border-color: var(--teal-main);
    box-shadow: 0 0 0 5px rgba(0, 191, 165, 0.1);
}

.input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 16px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
}

.currency-prefix {
    font-weight: 800;
    color: var(--teal-main);
    margin-right: 10px;
    font-size: 18px;
}

.fee-info {
    background: rgba(0, 191, 165, 0.08);
    color: #00796b;
    padding: 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 15px;
    border: 1px dashed var(--teal-main);
}

.wide-btn {
    margin-top: 10px;
    box-shadow: 0 12px 24px rgba(0, 191, 165, 0.25);
}

.modal-balance-hint {
    text-align: center;
    background: rgba(0, 191, 165, 0.05);
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-grey);
}
.modal-balance-hint span { color: var(--teal-main); }
.modal-balance-hint small { font-weight: 500; opacity: 0.7; margin-left: 5px; }

.conversion-hint {
    font-size: 12px;
    font-weight: 600;
    color: var(--teal-main);
    margin-top: 8px;
    padding-left: 5px;
}

.limit-card {
    background: #f0f9f8;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 25px;
    color: var(--text-dark);
    border: 1px solid rgba(0, 191, 165, 0.1);
}

.limit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 12px;
}

.limit-header span {
    color: var(--text-grey);
    font-weight: 600;
}

.limit-header b {
    color: var(--teal-main);
    font-size: 15px;
    font-weight: 800;
}

.limit-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(0, 191, 165, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.limit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00bfa5, #00d2b4);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.limit-footer {
    display: flex;
    justify-content: space-between;
}

.limit-info-item label {
    display: block;
    font-size: 10px;
    color: var(--text-grey);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.limit-info-item b {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
}

/* Confirmação Premium Refinada */
.confirm-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.confirm-item {
    margin-bottom: 12px;
}
.confirm-item label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0aec0;
    margin-bottom: 3px;
    font-weight: 700;
}
.confirm-item b {
    font-size: 15px;
    color: #1a202c;
    font-weight: 800;
}
.confirm-item span {
    font-size: 13px;
    color: #4a5568;
    font-weight: 600;
    display: block;
    word-break: break-all;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.confirm-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 15px 0;
    border-top: 1px dashed #e2e8f0;
}
.confirm-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}
.confirm-row b { color: #2d3748; font-weight: 700; }
.total-row {
    margin-top: 10px;
    padding-top: 10px;
    font-weight: 800;
}
.total-row b { color: var(--teal-main); font-size: 18px; }

.confirm-highlight {
    background: linear-gradient(135deg, #00bfa5 0%, #00d2b4 100%);
    color: white;
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 8px 20px rgba(0, 191, 165, 0.2);
}
.confirm-highlight span {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.9;
    letter-spacing: 1.5px;
}
.confirm-highlight h2 {
    font-size: 32px;
    font-weight: 900;
    margin-top: 2px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
/* Botão de QR Code Inline */
.icon-btn-inline {
    background: rgba(0, 191, 165, 0.1);
    border: none;
    color: var(--teal-main);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}
.icon-btn-inline:active { transform: scale(0.9); background: rgba(0, 191, 165, 0.2); }
/* Aviso de Cotação em tempo real */
.rate-notice {
    font-size: 13px;
    font-weight: 700;
    color: var(--teal-main);
    background: rgba(0, 191, 165, 0.08);
    padding: 10px 15px;
    border-radius: 14px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rate-notice::before {
    content: "trending_up";
    font-family: 'Material Symbols Outlined';
    margin-right: 8px;
    font-size: 18px;
}
.confirm-highlight small {
    display: block;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 2px;
}
/* Receipt v3 (Light Theme) */
.receipt-card {
    background: #f8fafc;
    text-align: center;
    padding: 30px 20px !important;
}

.receipt-success-header {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.check-animation {
    width: 60px;
    height: 60px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.2);
}

.receipt-success-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
    margin: 0;
}

.receipt-success-header p {
    font-size: 13px;
    color: #64748b;
    margin-top: 5px;
}

.receipt-amount-display {
    margin-bottom: 30px;
}

.receipt-amount-display span {
    font-size: 36px;
    font-weight: 900;
    color: #0d9488;
}

.receipt-details-box {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 30px;
    text-align: left;
}

.rec-row-v2 {
    margin-bottom: 12px;
}

.rec-row-v2 label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 2px;
}

.rec-row-v2 b {
    font-size: 14px;
    color: #1e293b;
    font-weight: 800;
    word-break: break-all;
}

.rec-divider-v2 {
    height: 1px;
    border-top: 1px dashed #e2e8f0;
    margin: 12px 0;
}

.teal-text {
    color: #0d9488 !important;
}

.receipt-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn-v2 {
    width: 100%;
    background: #e2eeec;
    border: none;
    color: #0d9488;
    padding: 16px;
    border-radius: 18px;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.primary-btn-v2 {
    width: 100%;
    background: linear-gradient(135deg, #0d9488 0%, #00bfa5 100%);
    border: none;
    color: white;
    padding: 16px;
    border-radius: 18px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(13, 148, 136, 0.2);
}

.primary-btn-v2:active {
    transform: scale(0.98);
}
