/* ========================================
   FAMILYTRACK - APP DE RASTREO FAMILIAR
   Diseño moderno y responsive
   ======================================== */

/* Variables CSS */
:root {
    --primary: #00d4ff;
    --primary-dark: #00a8cc;
    --secondary: #7c4dff;
    --accent: #00ff88;
    --danger: #ff4757;
    --warning: #ffa502;
    --dark-bg: #1a1a2e;
    --dark-surface: #16213e;
    --dark-card: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: 0.3s ease;
    --radius: 16px;
    --radius-sm: 8px;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* Evita scroll doble, lo manejan las pantallas internas */
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Clase utilitaria */
.hidden {
    display: none !important;
}

/* ========== PANTALLA DE CARGA ========== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    text-align: center;
}

.loader i {
    font-size: 4rem;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

.loader p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.app-container {
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    /* El scroll lo manejarán las pantallas internas */
}

/* ========== PANTALLA DE AUTH ========== */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-surface) 100%);
    overflow-y: auto;
    z-index: 1000;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    border-radius: var(--radius);
    padding: 4px;
}

.auth-tab {
    padding: 0.75rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary);
    color: var(--dark-bg);
}

.auth-form {
    width: 100%;
    max-width: 350px;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.privacy-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 12px;
    border-radius: var(--radius);
    margin: 15px 0;
    border-left: 4px solid var(--primary);
}

.privacy-notice i {
    color: var(--primary);
    font-size: 1.2rem;
}

.privacy-notice p {
    font-size: 0.8rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px 0;
    font-size: 0.85rem;
}

.checkbox-group input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-group a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 700;
    padding: 0 4px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    transition: var(--transition);
}

.checkbox-group a:hover {
    background: rgba(0, 212, 255, 0.2);
    color: #fff;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

/* Estilos de Modales Legales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: modal-slide-in 0.4s ease-out;
}

@keyframes modal-slide-in {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
}

.modal-header h3 {
    margin: 0;
    color: #1a1a2e;
    font-weight: 800;
}

.close-modal {
    background: none;
    border: none;
    color: #1a1a2e;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 2.5rem 2rem;
    max-height: 50vh;
    overflow-y: auto;
    font-size: 1.1rem;
    color: #1a1a2e;
    line-height: 1.6;
}

.modal-body h4 {
    color: var(--secondary);
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 700;
}

.modal-body p {
    margin-bottom: 1.2rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    background: #fdfdfd;
}

.modal-footer .btn-primary {
    max-width: 200px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Estilos para sección de perfil */
.profile-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.profile-section:last-child {
    border-bottom: none;
}

.profile-section h4 {
    color: var(--secondary);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.device-info {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.device-info p {
    margin: 0.5rem 0;
    color: #1a1a2e !important;
    font-size: 0.95rem;
}

.device-info strong {
    color: #1a1a2e !important;
}

.device-info span {
    color: #333 !important;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Estilos para historial */
.history-controls {
    margin-bottom: 1.5rem;
}

.history-stats {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
}

.history-stats h4 {
    margin: 0 0 1rem 0;
    color: var(--secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-bg);
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.history-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Estilos para configuración */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    color: var(--secondary);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.setting-info {
    flex: 1;
}

.setting-info strong {
    display: block;
    color: #1a1a2e !important;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.setting-info p {
    font-size: 0.85rem;
    color: #1a1a2e !important;
    margin: 0;
}

.setting-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark-bg);
    font-family: inherit;
    cursor: pointer;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block !important;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
    z-index: 1;
    visibility: visible !important;
    opacity: 1 !important;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc !important;
    transition: 0.4s;
    border-radius: 24px;
    z-index: 2;
    display: block !important;
    visibility: visible !important;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    z-index: 3;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Zona de peligro */
.danger-zone {
    background: #fff5f5;
    border: 2px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.danger-zone h4 {
    color: var(--danger);
}

.danger-warning {
    color: #1a1a2e !important;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.btn-danger {
    width: 100%;
    padding: 1rem;
    background: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #e63946;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3);
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: #5f27cd;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.3);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.auth-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
}

.auth-message.error {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.auth-message.success {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
}

/* ========== PANTALLA PRINCIPAL ========== */
.main-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.header-left i {
    color: var(--primary);
    font-size: 1.25rem;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.header-btn i {
    transition: transform 0.5s ease;
}

.header-btn.loading i {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.nav-btn.active i {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.nav-btn.active span {
    font-weight: 600;
}

/* Mapa */
.map-container {
    flex: 1;
    width: 100%;
    z-index: 1;
}

#map {
    height: 100%;
    width: 100%;
}

/* Panel de familiares */
.family-panel {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    background: var(--dark-surface);
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 50;
    transition: transform var(--transition);
}

.family-panel.collapsed .panel-content {
    display: none;
}

.family-panel.collapsed .panel-toggle i {
    transform: rotate(180deg);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    cursor: pointer;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h3 i {
    color: var(--primary);
}

.panel-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.panel-toggle i {
    transition: transform var(--transition);
}

.panel-content {
    padding: 0 1rem 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.family-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.family-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.family-member:hover {
    background: rgba(0, 212, 255, 0.1);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.member-info {
    flex: 1;
}

.member-info h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-battery {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

.member-battery i {
    margin-right: 4px;
}

.member-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.member-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.member-status.online {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.member-status.offline {
    background: var(--text-muted);
}

.btn-add-family {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-family:hover {
    background: rgba(0, 212, 255, 0.2);
}

/* Botón mi ubicación */
.btn-my-location {
    position: absolute;
    right: 1rem;
    bottom: 290px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: var(--dark-bg);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 50;
    transition: var(--transition);
}

.btn-my-location:hover {
    transform: scale(1.1);
}

/* Toggle compartir ubicación */
.share-toggle {
    position: absolute;
    left: 1rem;
    bottom: 290px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--dark-surface);
    border-radius: 25px;
    font-size: 0.8rem;
    z-index: 50;
    box-shadow: var(--shadow);
}

.auth-container {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
    z-index: 10;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

/* Scrollbar personalizada para el formulario */
.auth-container::-webkit-scrollbar {
    width: 6px;
}

.auth-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-muted);
    border-radius: 24px;
    transition: var(--transition);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

input:checked+.slider {
    background: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Navegación inferior */
.bottom-nav {
    display: flex;
    background: var(--dark-surface);
    border-top: 1px solid var(--glass-border);
    padding: 0.5rem;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn i {
    font-size: 1.25rem;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn:hover {
    color: var(--primary);
}

/* ========== MENÚ LATERAL ========== */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--dark-surface);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition);
}

.side-menu:not(.hidden) {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-details h4 {
    font-weight: 600;
}

.user-details p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.close-menu {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.menu-list {
    list-style: none;
    padding: 1rem 0;
}

.menu-list li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.menu-list li a:hover {
    background: var(--glass-bg);
}

.menu-list li a i {
    width: 20px;
    color: var(--primary);
}

.menu-list li a.logout {
    color: var(--danger);
}

.menu-list li a.logout i {
    color: var(--danger);
}

.menu-list .divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 1.5rem;
}

.menu-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    background: var(--dark-surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.close-modal {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.invite-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.invite-code span {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    color: var(--primary);
}

.btn-copy {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: var(--dark-bg);
    cursor: pointer;
}

.divider-text {
    text-align: center;
    color: var(--text-muted);
    margin: 1rem 0;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--glass-border);
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 768px) {
    .auth-screen {
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(0,212,255,0.2)"/><circle cx="40" cy="80" r="1" fill="rgba(124,77,255,0.2)"/></svg>'),
            linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-surface) 100%);
    }

    .family-panel {
        left: auto;
        right: 1rem;
        bottom: 80px;
        width: 320px;
        border-radius: var(--radius);
    }

    /* SOS Button */
    .sos-btn {
        position: absolute;
        bottom: 150px;
        right: 20px;
        width: 70px;
        height: 70px;
        background: #ff4757;
        color: white;
        border: none;
        border-radius: 50%;
        font-weight: 900;
        font-size: 1.2rem;
        box-shadow: 0 4px 15px rgba(255, 71, 87, 0.5);
        z-index: 1000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: pulse-sos 2s infinite;
        transition: var(--transition);
    }

    .sos-btn.active {
        background: #2f3542;
        animation: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    @keyframes pulse-sos {
        0% {
            transform: scale(1);
            box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
        }

        70% {
            transform: scale(1.1);
            box-shadow: 0 0 0 20px rgba(255, 71, 87, 0);
        }

        100% {
            transform: scale(1);
            box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
        }
    }

    .emergency-alert {
        animation: emergency-flash 1s infinite alternate;
    }

    @keyframes emergency-flash {
        from {
            color: #ff4757;
            transform: scale(1);
        }

        to {
            color: #fff;
            transform: scale(1.1);
        }
    }

    .alert-banner {
        background: #ff4757;
        color: white;
        padding: 10px;
        text-align: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        font-weight: bold;
        display: none;
    }

    .btn-my-location {
        bottom: 100px;
    }

    .share-toggle {
        bottom: 100px;
    }
}

/* Estilos de marcadores del mapa */
.custom-marker {
    background: none;
    border: none;
}

.marker-content {
    position: relative;
    width: 40px;
    height: 50px;
}

.marker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.marker-avatar.me {
    border-color: var(--accent);
    background: var(--dark-bg);
}

.marker-pin {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid white;
}
/* ========== SUBSCRIPTION & PAYMENT STYLES ========== */

/* Modal Large */
.modal-large {
    max-width: 800px;
}

/* Subscription Message */
.subscription-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f0f8ff;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.subscription-message i {
    font-size: 2rem;
    color: var(--primary);
}

.subscription-message p {
    margin: 0;
    color: #1a1a2e !important;
    font-size: 1rem;
}

/* Plans Container */
.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.plan-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.plan-card.recommended {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e0f7ff 0%, #ffffff 100%);
}

.plan-card.recommended::before {
    content: 'Recomendado';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--primary);
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}

.plan-price small {
    font-size: 1rem;
    color: #666;
}

.plan-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.plan-features li {
    padding: 0.5rem 0;
    color: #1a1a2e;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li i {
    color: var(--accent);
    font-size: 0.8rem;
}

.plan-select-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.plan-select-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Selected Plan Info */
.selected-plan-info {
    background: #f0f8ff;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: center;
}

.selected-plan-info h4 {
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
}

.selected-plan-info p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Payment Methods Grid */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.payment-method-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.payment-method-card i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.payment-method-card.yape i {
    color: #722c8e;
}

.payment-method-card.plin i {
    color: #00d4d4;
}

.payment-method-card.bank i {
    color: #002c77;
}

.payment-method-card h5 {
    margin: 0;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
}

/* Payment Instructions */
.payment-instructions {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

.payment-qr {
    text-align: center;
    margin: 1.5rem 0;
}

.payment-qr img {
    max-width: 300px;
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.payment-details {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.payment-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.payment-detail-item:last-child {
    border-bottom: none;
}

.payment-detail-item strong {
    color: #1a1a2e;
}

.payment-detail-item span {
    color: #666;
    font-family: monospace;
    font-weight: 600;
}

/* Payment Proof Section */
.payment-proof-section {
    margin-top: 2rem;
}

.payment-proof-section h4 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* File Upload Area */
.file-upload-area {
    margin: 1rem 0;
    position: relative;
}

.upload-placeholder {
    border: 2px dashed #ccc;
    border-radius: var(--radius-sm);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-placeholder:hover {
    border-color: var(--primary);
    background: #f0f8ff;
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--primary);
    display: block;
    margin-bottom: 1rem;
}

.upload-placeholder p {
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.file-types {
    color: #999;
    font-size: 0.85rem;
    display: block;
}

.upload-preview {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.upload-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #f5f5f5;
}

.btn-remove-file {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    transform: scale(1.1);
    background: #e63946;
}

.btn-block {
    width: 100%;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Payments List */
.payments-list {
    max-height: 500px;
    overflow-y: auto;
}

.payment-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 4px solid #ccc;
}

.payment-item.pending {
    border-left-color: var(--warning);
}

.payment-item.verified {
    border-left-color: var(--accent);
}

.payment-item.rejected {
    border-left-color: var(--danger);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.payment-header h5 {
    margin: 0;
    color: #1a1a2e;
}

.payment-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-status.pending {
    background: rgba(255, 165, 2, 0.2);
    color: var(--warning);
}

.payment-status.verified {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent);
}

.payment-status.rejected {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger);
}

.payment-info {
    color: #666;
    font-size: 0.9rem;
}

.payment-info p {
    margin: 0.25rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .plans-container {
        grid-template-columns: 1fr;
    }
    
    .payment-methods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-large {
        max-width: 95%;
    }
}

