:root {
    /* Calvin Klein + Apple - Minimalist Premium Palette */
    --primary: #1D4ED8;       /* Deep Blue Accent */
    --primary-hover: #1e40af;
    --bg: #FFFFFF;            /* Pure White */
    --bg-alt: #F9FAFB;        /* Subtle Gray */
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-glow: rgba(29, 78, 216, 0.15);
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #FFFFFF;
    --bg-alt: #F9FAFB;
    --studio-bg: radial-gradient(circle at top right, #FFFFFF 0%, #F3F4F6 100%);
    --text: #0F172A;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-on-dark: #FFFFFF;
    --border: #E2E8F0;
    --border-dark: #CBD5E1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.04);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-heavy: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.4);
    --accent-gradient: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%);
    
    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* --- Utilities & Visibility --- */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
}

/* --- App Shell Isolation --- */
body.is-public #sidebar,
body.is-public #bottom-nav,
body.is-public #fab,
body.is-public #mobile-header {
    display: none !important;
}

#sidebar {
    width: 240px;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 3000; /* Sidebar siempre arriba de todo */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.05em;
    margin-bottom: 3rem;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: #F3F4F6;
    color: var(--text);
}

.nav-links a.active {
    background: rgba(29, 78, 216, 0.05);
    color: var(--primary);
    font-weight: 500;
}

.nav-links a i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.nav-links a.active i {
    opacity: 1;
}

.sidebar-clinic-info {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.sidebar-clinic-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: var(--text);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-info a {
    text-decoration: none;
    color: var(--primary);
}

.plan-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    display: inline-block;
}

.plan-basic { background: #F3F4F6; color: #4B5563; }
.plan-pro { background: rgba(29, 78, 216, 0.1); color: var(--primary); }
.plan-premium { background: var(--text); color: white; }

#main-content {
    flex: 1;
    padding: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 500;
}

/* Minimalist Primary Button */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.23);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-alt);
    border-color: var(--border-dark);
    transform: translateY(-1px);
}

/* Premium Utilities */
.glass-morphism {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.soft-layer {
    box-shadow: var(--shadow-premium);
}

.is-public {
    background: var(--studio-bg);
    background-attachment: fixed;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(29, 78, 216, 0.2);
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.glass-card:hover {
    background: var(--glass-heavy);
    border-color: rgba(29, 78, 216, 0.3);
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Mobile Layouts */
#mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

#mobile-header .logo {
    margin-bottom: 0;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

/* Bottom Nav - Solo visible en Dashboard móvil */
#bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    #bottom-nav {
        display: flex;
    }
}

/* Public Layout Styles */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
}

.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

@media (max-width: 640px) {
    .public-header {
        padding: 1rem;
    }
    .public-header nav {
        display: none; /* Se usará un menú hamburguesa o links simplificados */
    }
}
#bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    gap: 4px;
}

#bottom-nav a.active {
    color: var(--primary);
}

#bottom-nav a i {
    width: 20px;
    height: 20px;
}

/* FAB */
#fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 50%;
    border: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    z-index: 1100;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    visibility: visible;
    opacity: 1;
}

.modal {
    background: var(--bg);
    width: 90%;
    max-width: 560px;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

/* Toast */
/* ─── AGENDA & STATUS (Phase 3) ─── */
.bg-today {
    background: rgba(29, 78, 216, 0.03);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.4;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

#toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--text);
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(200px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3000;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

tr:hover td {
    background: var(--bg-alt);
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.badge-warning { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.badge-danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

/* ─── UTILITIES & COMPONENTS (Phase 2) ─── */
.grid-2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 1rem; }
.gap-05 { gap: 0.5rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-05 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 2rem; }

.text-sm { font-size: 0.85rem; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.15em; }

.trial-banner {
    background: #000;
    color: #FFF;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.trial-banner i {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.announcement-card {
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.announcement-card i {
    margin-top: 0.25rem;
    color: var(--primary);
    width: 24px;
    min-width: 24px;
}

.announcement-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── TABS & PATIENT DETAIL (Phase 2) ─── */
.tabs-container {
    width: 100%;
}

.tabs-header {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--text);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text);
}

.lock-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.locked-feature-content {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem;
}

.lock-visual {
    width: 64px;
    height: 64px;
    background: var(--bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.lock-visual i { width: 32px; height: 32px; }

.locked-feature-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.locked-feature-content p {
    max-width: 380px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .tabs-header { gap: 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn { white-space: nowrap; }
}

/* Utilities */
.w-100 { width: 100%; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

/* Responsive */
.recovery-card {
    transition: transform 0.2s;
    border: 1px solid var(--border);
}
.recovery-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.sidebar-label {
    color: var(--text-light);
    font-size: 0.65rem;
    padding: 0 1rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body { flex-direction: column; }
    #sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        transition: left 0.3s ease;
        z-index: 4000; /* En móvil, por encima de overlays de header */
    }
    #sidebar.open, #sidebar.active { left: 0; }
    #main-content {
        padding: 6rem 1.5rem 6rem;
    }
    #mobile-header, #bottom-nav, #fab { display: flex; }
}

/* ─── PUBLIC PAGES (Landing, Pricing, Register) ─── */
body.is-public {
    background: #FFFFFF;
    display: block; /* Override flex for landing layout */
}

body.is-public #sidebar {
    display: none !important;
}

body.is-public #main-content {
    margin: 80px auto 0; /* Space for fixed header */
    padding: 2rem 1.5rem;
    max-width: 1400px;
    width: 100%;
}

.public-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    z-index: 2000;
}

.public-header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.public-header nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.public-header nav a:hover {
    opacity: 0.6;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: 6rem 0;
    min-height: 80vh;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ─── NEW MODULES: INSIGHTS & RECOVERY (Phase 7) ─── */

:root {
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
}

/* Utility removed to avoid redundancy with .glass-card */

/* Insights Styles */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding-top: 2rem;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 100%;
    min-height: 4px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    opacity: 0.8;
    transition: all 0.5s ease;
    position: relative;
}

.bar:hover {
    opacity: 1;
    transform: scaleX(1.1);
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
}

/* Recovery Styles */
.recovery-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recovery-item {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.recovery-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.recovery-p-info h4 {
    margin-bottom: 2px;
}

.recovery-meta {
    display: flex;
    gap: 1rem;
    margin-top: 4px;
}

.meta-pill {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Export Hub Styles */
.export-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.export-card {
    text-align: center;
    padding: 3rem 2rem;
}

.export-icon-container {
    width: 64px;
    height: 64px;
    background: rgba(29, 78, 216, 0.05);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

@media (max-width: 1024px) {
    .insight-grid { grid-template-columns: 1fr; }
}

/* Responsive fixes for existing items */
@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; }
    .stats-grid { gap: 1rem; margin-bottom: 2rem; }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.hero-visual {
    position: relative;
}

.glass-preview {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
}

/* Feature Grid */
.features-grid-public {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding: 6rem 0;
}

.feature-card-public {
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.3s;
}

.feature-card-public:hover {
    border-color: var(--text);
}

.feature-card-public i {
    width: 32px;
    height: 32px;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.feature-card-public h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-card-public p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Pricing */
.pricing-header {
    text-align: center;
    padding: 6rem 0 4rem;
}

.pricing-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ─── FORMS & INPUTS (Phase 3) ─── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--text);
    background: #FFF;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 6rem;
}

.pricing-card {
    padding: 3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pricing-card.recommended {
    border: 2px solid var(--text);
    transform: scale(1.05);
    z-index: 10;
}

.pricing-card .plan-name {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.pricing-card .price {
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
}

.pricing-card .price .amount {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.pricing-card .price .currency, .pricing-card .price .period {
    color: var(--text-muted);
    font-weight: 500;
}

.plan-features {
    list-style: none;
    margin-bottom: 3rem;
    flex: 1;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.plan-features li i {
    width: 16px;
    height: 16px;
    color: var(--success);
}

/* Split Layout (Register) */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.split-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
}

.visual-content {
    position: relative;
    z-index: 10;
}

.split-form-container {
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

/* Sidebar Responsive Logic */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -240px;
        transition: left 0.3s ease;
        z-index: 2000;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }
    
    #sidebar.active {
        left: 0;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }
    
    .split-visual {
        display: none;
    }
}

/* Hero & Feature Refinements */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 6rem 0;
    min-height: 80vh;
}

.icon-circle {
    width: 48px;
    height: 48px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-preview-container {
    position: relative;
    border-radius: 20px;
    padding: 1rem;
    background: white;
}

.glass-preview-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}
/* ─── PHASE 7 REFINEMENTS (RX, 3D, RECOVERY) ─── */
.rx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.rx-item {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.rx-item:hover {
    background: #FFF;
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.viewer-container-main {
    background: #000;
    border: 1px solid var(--border-dark);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.recovery-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.btn-mark-contacted {
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .recovery-card, .insight-grid .card {
    animation: fadeIn 0.4s ease-out forwards;
}

.rx-preview {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
}

.rx-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.rx-item:hover .rx-img {
    transform: scale(1.05);
}

.pdf-icon-container {
    text-align: center;
    color: white;
}

.pdf-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.pdf-name {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 8px;
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rx-info {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rx-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}

.rx-date {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* ─── PREMIUM POLISH PATCH ─── */
/* Utilidades de Visibilidad */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    #bottom-nav { display: flex !important; }
    #mobile-header { display: flex !important; }
    #fab { display: flex !important; }
    
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* Aislamiento Total del Dashboard en Modo Público */
body.is-public #sidebar,
body.is-public #bottom-nav,
body.is-public #fab,
body.is-public #mobile-header {
    display: none !important;
}

/* Estilos de Páginas Públicas */
.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
}

