/* ==============================================================================
   LA TIERRITA - Hoja de Estilos Principal
   Identidad visual colombiana, responsive, moderna y Modales SweetAlert
   ============================================================================== */

:root {
    --verde-profundo: #174B3A;
    --verde-medio:    #24634F;
    --verde-claro:    #E8F5E9;
    --amarillo-calido:#F6D98A;
    --amarillo-dorado:#D4AF37;
    --terracota:      #C76B45;
    --terracota-hover:#B35A35;
    --azul-caribe:    #3695B5;
    --crema:          #FFF4DC;
    --crema-claro:    #FFFAF0;
    --texto-oscuro:   #1E293B;
    --texto-claro:    #F8FAFC;
    --borde-suave:    rgba(0, 0, 0, 0.12);
    --sombra-suave:   0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --sombra-fuerte:  0 20px 30px -10px rgba(23, 75, 58, 0.3);
    --radio:          14px;
    --fuente:         system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--fuente);
    background: linear-gradient(135deg, #0F3327 0%, var(--verde-profundo) 50%, #10382B 100%);
    color: var(--texto-oscuro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Encabezado */
.app-header {
    background: rgba(23, 75, 58, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--amarillo-calido);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--crema);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    background: var(--amarillo-calido);
    color: var(--verde-profundo);
    font-weight: 900;
    font-size: 1.4rem;
    padding: 6px 14px;
    border-radius: 10px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--amarillo-calido);
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--crema);
    opacity: 0.9;
    font-style: italic;
}

.header-user-panel {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(246, 217, 138, 0.4);
}

/* Contenedor Principal */
.main-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
}

/* Pantallas y Tarjetas */
.screen {
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.hidden {
    display: none !important;
}

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

.card {
    background: var(--crema);
    border-radius: var(--radio);
    padding: 30px;
    box-shadow: var(--sombra-fuerte);
    border: 2px solid rgba(246, 217, 138, 0.6);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--verde-profundo);
    margin-bottom: 8px;
    text-align: center;
}

.card-subtitle {
    font-size: 0.95rem;
    color: #64748B;
    text-align: center;
    margin-bottom: 24px;
}

/* Formularios */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--verde-profundo);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #CBD5E1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #FFF;
    color: var(--texto-oscuro);
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--verde-profundo);
    box-shadow: 0 0 0 3px rgba(23, 75, 58, 0.2);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--terracota);
    color: #FFF;
    box-shadow: 0 4px 10px rgba(199, 107, 69, 0.3);
}

.btn-primary:hover {
    background: var(--terracota-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--verde-profundo);
    color: var(--amarillo-calido);
}

.btn-secondary:hover {
    background: var(--verde-medio);
}

.btn-accent {
    background: var(--amarillo-calido);
    color: var(--verde-profundo);
    border: 1px solid var(--amarillo-dorado);
}

.btn-accent:hover {
    background: #eed07d;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--crema);
    color: var(--crema);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Selector de Personajes con Avatares Vectoriales */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.character-card {
    background: #FFF;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character-card:hover {
    border-color: var(--terracota);
    transform: translateY(-2px);
    box-shadow: var(--sombra-suave);
}

.character-card.selected {
    border-color: var(--verde-profundo);
    background: var(--verde-claro);
    box-shadow: 0 0 0 3px rgba(23, 75, 58, 0.3);
}

.character-avatar-img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin-bottom: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    border: 2.5px solid #FFF;
}

.character-name {
    font-weight: 800;
    color: var(--verde-profundo);
    font-size: 0.95rem;
}

.character-role {
    font-size: 0.75rem;
    color: var(--terracota);
    font-weight: 600;
    margin-bottom: 4px;
}

.character-motto {
    font-size: 0.7rem;
    color: #64748B;
    font-style: italic;
    line-height: 1.2;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #F87171;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

/* Notificación Flotante de Dinero (Cash Float Toast) */
.cash-toast {
    position: fixed;
    top: 80px;
    right: 30px;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 1.1rem;
    color: #FFF;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 3000;
    animation: slideInDown 0.4s ease-out, fadeOutUp 0.5s ease-in 2.5s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cash-toast-positive {
    background: linear-gradient(135deg, #2E7D32, #43A047);
    border: 2px solid #A5D6A7;
}

.cash-toast-negative {
    background: linear-gradient(135deg, #C62828, #E53935);
    border: 2px solid #EF9A9A;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* ==============================================================================
   SISTEMA DE MODALES ESTILO SWEETALERT
   ============================================================================== */
.sweet-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 51, 39, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.sweet-modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.sweet-modal-box {
    background: #FFFDF9;
    border: 3px solid var(--verde-profundo);
    border-radius: 20px;
    padding: 30px 24px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    transform: scale(0.85);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.sweet-modal-backdrop.visible .sweet-modal-box {
    transform: scale(1);
}

.sweet-modal-icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.sweet-modal-icon-circle.type-success {
    background: #DCFCE7;
    border: 3px solid #22C55E;
}

.sweet-modal-icon-circle.type-error {
    background: #FEE2E2;
    border: 3px solid #EF4444;
}

.sweet-modal-icon-circle.type-warning {
    background: #FEF9C3;
    border: 3px solid #EAB308;
}

.sweet-modal-icon-circle.type-info, .sweet-modal-icon-circle.type-card {
    background: #E0F2FE;
    border: 3px solid #0EA5E9;
}

.sweet-modal-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--verde-profundo);
    margin-bottom: 10px;
}

.sweet-modal-message {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.45;
    margin-bottom: 22px;
}

.sweet-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Pie de Página */
.app-footer {
    text-align: center;
    padding: 14px;
    font-size: 0.8rem;
    color: var(--crema);
    opacity: 0.7;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
