/* ============================================
   DEFI ORACLE - SISTEMA DE DISEÑO MVP
   ============================================ */

/* === VARIABLES / TOKENS === */
:root {
    /* Colores principales */
    --primary-blue: #1974CE;
    --secondary-blue: #D8E2E9;
    --accent-green: #5C8240;
    --dark-slate: #211C10;
    --neutral-gray: #9AA1A1;
    --light-background: #E3EAEE;
    
    /* Colores derivados */
    --primary-blue-hover: #1563B0;
    --accent-green-light: #E8F0E3;
    --secondary-blue-light: #EDF2F5;
    --error-red: #DC2626;
    --error-red-light: #FEF2F2;
    --warning-yellow: #F59E0B;
    --warning-yellow-light: #FEF3C7;
    
    /* Fondos */
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    
    /* Bordes */
    --border-light: #E5E7EB;
    --border-input: #D1D5DB;
    
    /* Tipografía */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    
    /* Tamaños de fuente */
    --font-h1: 26px;
    --font-h2: 20px;
    --font-body: 15px;
    --font-caption: 13px;
    --font-small: 12px;
    
    /* Pesos */
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Radios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Espaciado */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    
    /* Tamaños */
    --btn-height: 52px;
    --input-height: 50px;
    --tab-bar-height: 70px;
    --header-height: 56px;
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    color: var(--dark-slate);
    background: var(--light-background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.app-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--light-background);
    position: relative;
}

.page {
    padding-bottom: calc(var(--tab-bar-height) + 20px);
    min-height: 100vh;
}

.page-content {
    padding: var(--space-lg);
}

/* === HEADER === */
.header {
    background: var(--bg-white);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

.header-title {
    font-size: var(--font-h2);
    font-weight: var(--font-semibold);
    color: var(--dark-slate);
}

.header-back {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-background);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.header-action {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
}

/* === TIPOGRAFÍA === */
.h1 {
    font-size: var(--font-h1);
    font-weight: var(--font-semibold);
    color: var(--dark-slate);
    line-height: 1.3;
}

.h2 {
    font-size: var(--font-h2);
    font-weight: var(--font-semibold);
    color: var(--dark-slate);
    line-height: 1.4;
}

.body {
    font-size: var(--font-body);
    font-weight: var(--font-regular);
    color: var(--dark-slate);
    line-height: 1.5;
}

.caption {
    font-size: var(--font-caption);
    color: var(--neutral-gray);
    line-height: 1.4;
}

.small {
    font-size: var(--font-small);
    color: var(--neutral-gray);
}

/* === BOTONES === */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: var(--btn-height);
    padding: 0 var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: var(--font-body);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-blue-hover);
}

.btn-primary:disabled {
    background: var(--neutral-gray);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--dark-slate);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--light-background);
}

.btn-text {
    background: transparent;
    color: var(--primary-blue);
    height: auto;
    padding: var(--space-sm);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* === INPUTS === */
.input-group {
    margin-bottom: var(--space-lg);
}

.input-label {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--font-medium);
    color: var(--dark-slate);
    margin-bottom: var(--space-sm);
}

.input {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--space-lg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    background: var(--bg-input);
    transition: all 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(25, 116, 206, 0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input {
    padding-left: 48px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-gray);
    font-size: 18px;
}

.input-error {
    border-color: var(--error-red);
}

.input-error-text {
    color: var(--error-red);
    font-size: var(--font-small);
    margin-top: var(--space-xs);
}

/* === SELECT === */
.select {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--space-lg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    background: var(--bg-input);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239AA1A1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    cursor: pointer;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-small);
    font-weight: var(--font-medium);
}

.badge-speed {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.badge-recommended {
    background: var(--secondary-blue);
    color: var(--primary-blue);
}

.badge-warning {
    background: var(--warning-yellow-light);
    color: var(--warning-yellow);
}

.badge-error {
    background: var(--error-red-light);
    color: var(--error-red);
}

/* === CHIPS === */
.chips {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.chip {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-caption);
    font-weight: var(--font-medium);
    background: var(--secondary-blue);
    color: var(--dark-slate);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: white;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: var(--space-sm);
    background: var(--light-background);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
}

.tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: var(--font-caption);
    font-weight: var(--font-medium);
    color: var(--neutral-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

/* === BOTTOM TAB BAR === */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: var(--bg-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 var(--space-sm);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-width: 430px;
    margin: 0 auto;
}

.tab-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neutral-gray);
    transition: all 0.2s;
    text-decoration: none;
}

.tab-bar-item.active {
    color: var(--primary-blue);
}

.tab-bar-item .icon {
    font-size: 22px;
}

.tab-bar-item .label {
    font-size: 11px;
    font-weight: var(--font-medium);
}

/* Tab Enviar especial */
.tab-bar-item.tab-send {
    position: relative;
}

.tab-bar-item.tab-send .icon-wrapper {
    width: 52px;
    height: 52px;
    background: var(--secondary-blue);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.tab-bar-item.tab-send.active .icon-wrapper {
    background: var(--primary-blue);
}

.tab-bar-item.tab-send .icon {
    font-size: 24px;
    color: var(--primary-blue);
}

.tab-bar-item.tab-send.active .icon {
    color: white;
}

/* === LISTA === */
.list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.list-item:hover {
    background: var(--secondary-blue-light);
}

.list-item-avatar {
    width: 44px;
    height: 44px;
    background: var(--secondary-blue);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    color: var(--primary-blue);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: var(--font-medium);
    color: var(--dark-slate);
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: var(--font-caption);
    color: var(--neutral-gray);
}

.list-item-action {
    color: var(--neutral-gray);
    font-size: 18px;
}

.list-item-favorite {
    color: var(--warning-yellow);
}

/* === PROGRESS BAR === */
.progress-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.progress-step-dot {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--neutral-gray);
}

.progress-step.completed .progress-step-dot {
    background: var(--accent-green);
    color: white;
}

.progress-step.active .progress-step-dot {
    background: var(--primary-blue);
    color: white;
}

.progress-step-label {
    font-size: var(--font-small);
    color: var(--neutral-gray);
    text-align: center;
}

.progress-step.active .progress-step-label,
.progress-step.completed .progress-step-label {
    color: var(--dark-slate);
}

.progress-line {
    flex: 0.5;
    height: 2px;
    background: var(--border-light);
}

.progress-line.completed {
    background: var(--accent-green);
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 340px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: var(--font-h2);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-sm);
}

.modal-text {
    color: var(--neutral-gray);
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* === UTILIDADES === */
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-blue); }
.text-gray { color: var(--neutral-gray); }
.text-green { color: var(--accent-green); }
.text-error { color: var(--error-red); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.w-full { width: 100%; }

.hidden { display: none !important; }

/* === STICKY CTA === */
.sticky-cta {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + var(--space-lg));
    left: var(--space-lg);
    right: var(--space-lg);
    max-width: calc(430px - 32px);
    margin: 0 auto;
    z-index: 50;
}

/* Sin tab bar */
.sticky-cta.no-tab-bar {
    bottom: var(--space-lg);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* === SEARCH === */
.search-box {
    position: relative;
}

.search-box .input {
    padding-left: 48px;
}

.search-box .search-icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-gray);
}

/* === TOGGLE === */
.toggle {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
}

.toggle-switch {
    width: 48px;
    height: 28px;
    background: var(--border-light);
    border-radius: 14px;
    position: relative;
    transition: all 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: var(--radius-full);
    top: 3px;
    left: 3px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.toggle.active .toggle-switch {
    background: var(--primary-blue);
}

.toggle.active .toggle-switch::after {
    left: 23px;
}

/* === COPY ROW === */
.copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.copy-row:last-child {
    border-bottom: none;
}

.copy-row-label {
    font-size: var(--font-caption);
    color: var(--neutral-gray);
    margin-bottom: 2px;
}

.copy-row-value {
    font-weight: var(--font-medium);
}

.copy-btn {
    width: 36px;
    height: 36px;
    background: var(--light-background);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--secondary-blue);
}

/* === TIMER === */
.timer-banner {
    background: var(--warning-yellow-light);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--warning-yellow);
    font-weight: var(--font-medium);
}

/* === ANIMACIONES === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

/* === RESPONSIVE === */
@media (max-width: 430px) {
    .page-content {
        padding: var(--space-md);
    }
    
    .sticky-cta {
        left: var(--space-md);
        right: var(--space-md);
    }
}

/* Fondo marca Defi Oracle para login */
.defi-bg-strong {
    background:
        radial-gradient(circle at 10% 0%, rgba(44, 136, 218, 0.18), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(48, 193, 171, 0.18), transparent 50%),
        linear-gradient(180deg, #F2F9FF 0%, #EEF6F7 50%, #F3F7FA 100%);
}
