@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Color Palette - Cyber / Premium Dark */
    --bg-main: #06070a;
    --bg-darker: #020305;
    --accent-bg: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.4);
    --secondary-bg: #8b5cf6;

    --card-bg: rgba(15, 17, 26, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.2);

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --danger: #ff4d4d;
    --success: #00e699;

    --glass-blur: 16px;
    --primary-grad: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    --text-grad: linear-gradient(to right, #ffffff, #94a3b8);
    --mesh-grad: linear-gradient(45deg, #4f46e5, #8b5cf6, #ec4899);
}

/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    /* Permite scroll si el contenido es más alto que el viewport */
    min-height: 100vh;
}

#app {
    position: relative;
    height: 100%;
    width: 100%;
    z-index: 10;
}

/* Background Mesh Animation */
.mesh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    /* Evita bloquear interacciones */
}

.mesh-ball {
    position: absolute;
    filter: blur(100px);
    opacity: 0.15;
    border-radius: 50%;
}

.ball-1 {
    width: 600px;
    height: 600px;
    background: #4f46e5;
    top: -200px;
    right: -100px;
    animation: floating 20s infinite alternate;
}

.ball-2 {
    width: 500px;
    height: 500px;
    background: #ec4899;
    bottom: -100px;
    left: -100px;
    animation: floating 25s infinite alternate-reverse;
}

.ball-3 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    top: 50%;
    left: 40%;
    animation: floating 15s infinite linear;
}

@keyframes floating {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(100px, 50px) rotate(360deg);
    }
}

/* Screens */
.screen {
    display: none;
    height: 100vh;
    position: relative;
    /* Necesario para que z-index funcione */
    z-index: 10;
    animation: screenEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
    display: flex;
}

@keyframes screenEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* UI Elements */
.primary-btn {
    background: var(--primary-grad);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.primary-btn:hover::after {
    left: 100%;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.primary-btn.sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.primary-btn.full {
    width: 100%;
    justify-content: center;
}

.ghost-btn,
.nav-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ghost-btn:hover,
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-hover-border);
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.icon-btn:hover {
    color: white;
    border-color: var(--accent-bg);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Landing Screen */
#landing-screen {
    z-index: 20;
}

.landing-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 60px;
}

.auth-btns {
    display: flex;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-grad);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.badge {
    background: rgba(79, 70, 229, 0.1);
    color: #818cf8;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    max-width: 900px;
    line-height: 1;
    margin-bottom: 24px;
}

.hero h1 span {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 48px;
}

.cta-group {
    display: flex;
    gap: 20px;
}

/* Connection Screen */
#login-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #111421 0%, #06070a 100%);
}

.connection-overlay {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-card .back-to-landing {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-container {
    margin-bottom: 24px;
}

.input-container label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 14px 14px 14px 44px;
    border-radius: 12px;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: 0.3s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-bg);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.connection-actions {
    display: flex;
    gap: 12px;
}

/* Dashboard Layout */
#dashboard {
    height: 100vh;
}

.sidebar {
    width: 320px;
    background: var(--bg-darker);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
    overflow: hidden;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
}

.logo.sm {
    font-size: 1.25rem;
}

.logo-icon.sm {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.user-profile {
    margin: 32px 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-grad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-meta span {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-meta p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#logout-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
}

#logout-btn:hover {
    color: var(--danger);
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.nav-list {
    list-style: none;
}

.nav-list li,
.nav-item-btn {
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    text-align: left;
    transition: 0.2s;
}

.nav-list li i {
    font-size: 0.85rem;
}

.nav-list li:hover,
.nav-item-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-list li.active {
    background: rgba(79, 70, 229, 0.1);
    color: #a5b4fc;
    font-weight: 600;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 !important;
    gap: 0 !important;
}

.saved-item .nav-item-btn {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-saved {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 10px 14px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 10px 10px 0;
}

.delete-saved:hover {
    color: var(--danger);
    background: rgba(255, 77, 77, 0.1);
}

.sidebar-link {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--card-border);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    transition: 0.3s;
}

.sidebar-link:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 77, 77, 0.05);
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    margin-right: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.app-header {
    height: 80px;
    border-bottom: 1px solid var(--card-border);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.path-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.path-segment {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.path-segment i {
    color: var(--accent-bg);
}

.divider {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    background: var(--bg-darker);
    border: 1px solid var(--card-border);
    padding: 10px 14px 10px 40px;
    border-radius: 100px;
    color: white;
    width: 240px;
    font-family: inherit;
}

.view-container {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Document Grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 20px;
}

.doc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    height: 300px;
    overflow: hidden;
}

.doc-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-bg);
    box-shadow: 0 20px 40px -20px rgba(79, 70, 229, 0.3);
}

.doc-data-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.data-row {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
}

.data-row.id-row {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.3);
}

.data-key {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.data-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.val-string {
    color: var(--text-primary);
}

.val-number {
    color: #38bdf8;
}

.val-true {
    color: var(--success);
}

.val-false {
    color: var(--danger);
}

.val-object {
    color: #f472b6;
    font-style: italic;
}

.val-id {
    color: #a5b4fc;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modern-modal {
    background: var(--bg-main);
    width: 800px;
    height: 500px;
    display: flex;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
    animation: modalScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-side {
    width: 320px;
    background: var(--primary-grad);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-side i {
    font-size: 3rem;
    margin-bottom: 24px;
}

.modal-side h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1;
}

.modal-side h2 span {
    opacity: 0.7;
}

.modal-side p {
    opacity: 0.8;
    line-height: 1.6;
}

.modal-body {
    flex: 1;
    padding: 40px;
    background: var(--bg-darker);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.type-tag {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-bg);
}

.field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: 10px;
    color: white;
    font-family: inherit;
}

.switch-auth {
    margin-top: 24px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
}

.switch-auth a {
    color: var(--accent-bg);
    text-decoration: none;
    font-weight: 600;
}

/* Editor Panel */
.editor-panel {
    background: var(--bg-darker);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
}

.editor-header {
    padding: 24px 40px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-group i {
    color: var(--accent-bg);
}

.editor-content {
    padding: 40px;
    overflow-y: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.editor-actions {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.danger-btn {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.2);
    color: var(--danger);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.danger-btn:hover {
    background: var(--danger);
    color: white;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
}

.toast {
    background: rgba(20, 22, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Image Preview in Document Card */
.doc-card {
    display: flex;
    flex-direction: column;
}

.doc-info {
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.image-preview-container {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin: 0 auto 16px auto;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    position: relative;
    z-index: 2;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.doc-card:hover .image-preview-container img {
    transform: scale(1.05);
}

.doc-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-card:hover .doc-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.action-btn:hover {
    color: white;
    border-color: var(--accent-bg);
    background: var(--accent-bg);
}

.action-btn.clone:hover {
    background: var(--secondary-bg);
    border-color: var(--secondary-bg);
}

.action-btn.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Saved Connections Login */
.saved-connections-mini {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.saved-connections-mini label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.mini-nav-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mini-nav-list li {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-nav-list li:hover {
    border-color: var(--accent-bg);
    color: white;
    background: rgba(79, 70, 229, 0.1);
}

/* Profile Specific Styles */
.profile-side {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    align-items: center;
}

.avatar-upload-container {
    position: relative;
    margin-bottom: 24px;
}

.avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--accent-bg);
    object-fit: cover;
    background: var(--bg-darker);
    box-shadow: 0 0 30px var(--accent-glow);
}

.upload-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background: var(--primary-grad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #0f172a;
    transition: 0.3s;
}

.upload-badge:hover {
    transform: scale(1.1);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#settings-btn {
    margin-left: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
}

#settings-btn:hover {
    color: var(--accent-bg);
}

/* Password Toggle */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    width: 100%;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    transition: 0.2s;
}

.toggle-password:hover {
    color: white;
}

/* Responsive Design (Media Queries) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .landing-nav .auth-btns {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-darker);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .landing-nav .auth-btns.active {
        right: 0;
    }

    .user-profile {
        margin: 12px 0;
        padding: 10px;
        gap: 8px;
    }

    .user-profile .avatar {
        width: 32px;
        height: 32px;
    }

    .user-meta span {
        font-size: 0.85rem;
    }

    .user-meta p {
        font-size: 0.7rem;
    }

    .landing-nav .auth-btns .nav-btn,
    .landing-nav .auth-btns .primary-btn {
        width: 80%;
        justify-content: center;
        font-size: 1.1rem;
        padding: 16px;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-nav {
        display: block !important;
    }

    .main-content {
        padding-top: 0;
    }

    .app-header {
        height: auto;
        padding: 16px 24px;
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Auth Improvements */
    .modern-modal {
        flex-direction: column;
        width: 92%;
        height: auto;
        max-height: 95vh;
        overflow-y: auto;
    }

    .modal-side {
        width: 100%;
        padding: 30px 20px;
        text-align: center;
        min-height: auto;
    }

    .modal-side i {
        font-size: 2.5rem;
        margin-bottom: 16px;
    }

    .modal-side h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 30px 20px;
    }

    .field input,
    .input-wrapper input {
        font-size: 16px;
        /* Evita zoom automático en iOS */
        padding: 14px;
    }

    .primary-btn.full {
        padding: 16px;
        font-size: 1.1rem;
    }

    .login-card {
        padding: 30px 20px;
        width: 95%;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
    }

    .cta-group button {
        width: 100%;
        justify-content: center;
    }

    .login-card {
        padding: 24px;
    }

    .avatar-large {
        width: 100px;
        height: 100px;
    }
}

/* Footer */
.app-footer {
    padding: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
}

.landing-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.overlay-footer {
    margin-top: 32px;
}

.sidebar-footer {
    padding: 12px 0;
    margin-top: auto;
    margin-bottom: 24px;
    border-top: 1px dashed var(--card-border);
}

.app-footer a {
    color: var(--accent-bg);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.app-footer a:hover {
    color: white;
    text-shadow: 0 0 10px var(--accent-glow);
}

@media (max-width: 768px) {
    .app-footer {
        padding: 16px;
    }
}