@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* --- RESET & VARIABLES GLOBALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

body {
    background-color: #fafafa;
    color: #171717;
    padding: 80px 16px 16px 16px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* --- CLASES UTILITARIAS OPTIMIZADAS --- */
.d-none { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.text-uppercase { text-transform: uppercase; }
.full-width { width: 100% !important; }
.bg-danger { background-color: #dc2626 !important; }
.bg-secondary { background-color: #4b5563 !important; }
.bg-danger:hover { background-color: #b91c1c !important; }
.bg-secondary:hover { background-color: #374151 !important; }

/* --- COMPONENTE: LOGOTIPO ROBOTO (De global.css) --- */
.nav-logo-roboto {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #171717;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.3px;
    user-select: none;
}

.logo-solid-o {
    display: inline-block;
    width: 19px;
    height: 19px;
    background-color: #171717;
    border-radius: 50%;
    margin: 0 2px;
    flex-shrink: 0;
}

.logo-text-viajero {
    font-weight: 300;
    color: #171717;
    margin-left: 8px;
    letter-spacing: -0.1px;
}

/* --- BARRA DE NAVEGACIÓN SUPERIOR --- */
.main-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-bar-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

/* Botón Hamburguesa */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 20px;
    justify-content: center;
    z-index: 1002;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #171717;
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desplegable del menú */
.nav-overlay-menu {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.03);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 1001;
}

.nav-overlay-menu.active { max-height: 320px; }
.nav-links-list { list-style: none; padding: 8px 16px 16px 16px; display: flex; flex-direction: column; gap: 4px; }

.nav-links-list li a {
    display: block;
    padding: 10px 8px;
    color: #404040;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-links-list li a:hover { background-color: #f5f5f5; color: #171717; }
.nav-welcome-link { font-weight: 500 !important; color: #404040 !important; }
.nav-username { font-weight: 800; color: #10b981; }
.logout-item-container { margin-top: 10px; border-top: 1px solid #e5e5e5; padding-top: 12px; }

.nav-links-list li .btn-logout-nav {
    display: block;
    background-color: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    text-align: center;
    padding: 10px 8px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links-list li .btn-logout-nav:hover { background-color: rgba(239, 68, 68, 0.18); color: #b91c1c; }

/* --- ESTRUCTURA CONTENEDORA --- */
.profile-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
}

.emergency-header {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.sos-badge {
    background-color: #171717;
    color: #ffffff; 
    font-size: 1rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 15px;
    display: inline-block;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.emergency-header .profile-avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid #171717; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.emergency-header h2 { font-size: 1.5rem; font-weight: 700; }
.profile-status { font-size: 0.9rem; }

/* --- TARJETAS DE INFORMACIÓN (CARDS) --- */
.info-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-item { display: flex; flex-direction: column; gap: 4px; }
.label { font-size: 0.9rem; color: #737373; text-transform: uppercase; letter-spacing: 0.5px; }
.value { font-size: 0.9rem; font-weight: 700; color: #171717; }
.value.blood { color: #000000; }
.value.highlight { color: #262626; }
.value-text { font-size: 0.9rem; color: #404040; line-height: 1; font-weight: 700;}

/* Controles de Mini-Tabs */
.segmented-control-mini {
    display: flex;
    background: #ededf0;
    padding: 3px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.segment-btn-mini {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.segment-btn-mini.active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Slider Interno */
.slider-viewport-mini { width: 100%; overflow: hidden; border-radius: 12px; }
.slider-track-mini { display: flex; width: 200%; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.slide-pane { width: 50%; display: flex; flex-direction: column; gap: 10px; }

/* Formularios del Slider */
.form-sub {
    background: #f4f4f5;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    font-size: 13px;
    margin-top: 5px;
    text-align: left;
}

.form-label-mini { font-size:11px; font-weight:700; display: block; margin-bottom: 2px; }
.form-input-mini { width:100%; padding:8px; margin:4px 0; border-radius:6px; border:1px solid #ccc; box-sizing:border-box; }
.form-textarea-mini { width:100%; padding:8px; margin:4px 0; border-radius:6px; border:1px solid #ccc; font-family:sans-serif; box-sizing:border-box; resize:vertical; }
.form-checkbox-container { margin:8px 0; display:flex; align-items:center; gap:6px; }
.form-label-checkbox { text-transform:none; font-size:12px; font-weight:500; }
.form-btn-submit { background:#171717; color:#fff; border:none; padding:10px; width:100%; border-radius:6px; font-weight:700; cursor:pointer; transition: background 0.2s; }
.form-btn-submit:hover { background: #404040; }

/* Contacto de Emergencia */
.contact-box { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.contact-name { font-size: 0.9rem; font-weight: 700; color: #171717; }

/* --- BOTONES DE ACCIÓN --- */
.btn-call {
    background-color: #000000; 
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 20px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-call:hover { background-color: #262626; }
.btn-call:active { transform: scale(0.98); }
.btn-disabled { background-color: #3f3f46 !important; cursor: not-allowed !important; }

.btn-whatsapp {
    background-color: #25D366; 
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.btn-whatsapp:hover { background-color: #20ba56; }
.btn-whatsapp:active { transform: scale(0.98); }
.whatsapp-icon { width: 20px !important; height: 20px !important; flex-shrink: 0; }

/* --- SECCIÓN PROTEGIDA --- */
.secure-card { border: 1px solid #d4d4d4; }
.secure-notice { font-size: 0.9rem; color: #525252; line-height: 1.4; margin-bottom: 14px; }
.secure-form { display: flex; gap: 8px; margin-bottom: 4px; }

.secure-form input {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    padding: 12px;
    color: #171717;
    font-size: 0.9rem;
}
.secure-form input:focus { outline: none; border-color: #171717; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05); }

.secure-form button {
    background-color: #a3a3a3; 
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.secure-form button:hover { background-color: #737373; }

.secure-content-box { margin-top: 10px; padding-top: 14px; border-top: 1px solid #e5e5e5; display: flex; flex-direction: column; gap: 12px; }
.secure-item { display: flex; flex-direction: column; gap: 4px; }
.label-secure { font-size: 0.8rem; color: #525252; font-weight: 600; }
.value-secure-text { font-size: 0.95rem; color: #262626; line-height: 1.4; }
.encrypted-text { color: #a3a3a3; font-family: monospace; letter-spacing: 1px; }

/* --- CARD ERROR --- */
.error-card { background-color: #ffffff; border: 1px solid #e5e5e5; border-radius: 20px; padding: 40px 24px; text-align: center; }
.error-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.error-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: #171717; }
.error-card p { font-size: 0.95rem; color: #737373; line-height: 1.5; margin-bottom: 24px; }
.btn-error-home { display: inline-block; background-color: #000000; color: #ffffff; text-decoration: none; padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; transition: background-color 0.2s; }
.btn-error-home:hover { background-color: #262626; }

/* --- PIE DE PÁGINA --- */
.profile-footer { text-align: center; padding: 16px 0 8px; }
.profile-footer p { font-size: 0.8rem; color: #737373; }