/* === LOADING SCREEN === */
.bd-loading {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bd-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: fadeIn 0.6s ease-out;
}

/* Logo */
.bd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .bd-logo .icon {
        width: 44px;
        height: 44px;
        background: var(--mud-palette-primary);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .bd-logo .icon span {
            color: white;
            font-size: 24px;
        }

    .bd-logo h1 {
        font-size: 24px;
        font-weight: 800;
        color: var(--mud-palette-primary);
        margin: 0;
        letter-spacing: -0.02em;
    }

        .bd-logo h1 span {
            color: #3b82f6;
        }

/* Texto */
.bd-welcome {
    font-size: 14px;
    color: #64748b; /* slate-500 */
    margin-top: 4px;
}

/* Spinner */
.bd-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb; /* gray-200 */
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-top: 4px;
}

.bd-spinner-white {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: white;
}

.bd-spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Dark mode support for BD Loading */
.dark .bd-loading {
    background: #0f172a;
}

.dark .bd-logo h1 {
    color: white;
}

.dark .bd-welcome {
    color: #94a3b8;
}

.dark .bd-spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: #3b82f6;
}

/* ===== GLOBAL ===== */
body {
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
}

/* ===== EFFECTS ===== */
.ios-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.gradient-card {
    background: linear-gradient( 135deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 50%, var(--mud-palette-tertiary) 100% );
}

/* ===== BOTTOM NAV ===== */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 12px;
    color: #94a3b8; /* slate-400 */
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

    .nav-item .material-icons-outlined {
        font-size: 22px;
    }

    /* hover */
    .nav-item:hover {
        background-color: rgba(59, 130, 246, 0.08);
        color: #3b82f6;
    }

    /* active (NavLink) */
    .nav-item.active {
        background-color: rgba(59, 130, 246, 0.12);
        color: #3b82f6;
        font-weight: 700;
    }

    /* tap */
    .nav-item:active {
        transform: scale(0.95);
    }

    /* remove underline everywhere */
    .nav-item,
    .nav-item:hover,
    .nav-item:focus,
    .nav-item:visited {
        text-decoration: none;
    }

.mud-icon-root.mud-svg-icon {
    fill: var(--mud-palette-tertiary);
}

.btn-responsive .mud-button-icon-start {
    margin-inline-end: 0 !important;
}

.custom-input .mud-input-root {
    border-radius: 12px;
    padding: 6px 12px;
    fill: var(--mud-palette-tertiary);
}

/* underline */
.custom-input .mud-input-underline:before {
}

.custom-input .mud-input-underline:after {
}

/* focus violeta OUT */
.custom-input .mud-input:focus-within {
}

.custom-input input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.custom-input .mud-input-control:focus-within {
    outline: none;
}

.custom-input .mud-input-label.mud-focused {
}

.subtitulo-form {
    color: rgb(71 85 105); /* slate-600 */
}

.btn-esmeralda {
    background-color: rgb(5 150 105); /* emerald-600 */
    color: white;
    border-radius: 12px;
}

    .btn-esmeralda:hover {
        background-color: rgb(4 120 87); /* emerald-700 */
    }

.link-esmeralda {
    color: rgb(5 150 105);
    font-weight: 500;
}

    .link-esmeralda:hover {
        text-decoration: underline;
    }

.mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol {
    color: var(--mud-palette-primary) !important;
}

.mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol {
    color: var(--mud-palette-primary) !important;
}

.btn-outline-primary {
    background-color: white !important;
    border: 1px solid var(--mud-palette-primary) !important; /* celeste */
    color: var(--mud-palette-primary) !important;
}

    .btn-outline-primary:hover {
        background-color: rgb(239, 246, 255) !important; /* celeste muy suave */
    }

.side-item {
    @apply flex items-center gap-3 px-4 py-3 rounded-xl text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition font-medium;
}

    .side-item.active {
        @apply bg-primary text-white;
    }

.side-item {
    display: flex;
    align-items: center; /* 👈 clave */
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 500;
    color: #334155; /* slate-700 */
    transition: background 0.2s;
}

    .side-item:hover {
        background: #f1f5f9;
    }

.dark .side-item {
    color: #e5e7eb;
}

    .dark .side-item:hover {
        background: #1f2933;
    }

.side-item span.material-icons-outlined {
    font-size: 22px;
}

.side-item,
.side-item:hover,
.side-item:focus,
.side-item.active {
    text-decoration: none !important;
}


.mud-dialog {
    height: 100vh !important;
    max-height: auto !important;
}

.mud-dialog-content {
    height: 100%;
    max-height: calc(100vh - 64px); 
    overflow-y: auto;
}

.mud-dialog-width-full {
    height: auto !important;
}

/* SOLO este dialog */
.dialog-familiar.mud-dialog {
    height: auto !important;
    max-height: unset !important;
}

/* contenido */
.dialog-familiar .mud-dialog-content {
    height: auto !important;
    max-height: unset !important;
    overflow-y: visible !important;
}

/* Dialogs MEDIUM no fullscreen */
.mud-dialog.mud-dialog-width-md {
    height: auto !important;
    max-height: unset !important;
}

/* Contenido MEDIUM */
.mud-dialog-width-md .mud-dialog-content {
    height: auto !important;
    max-height: unset !important;
    overflow-y: visible !important;
}

/* Para tomar colores de la paleta del theme */
.custom-input .mud-input-underline:after {
    border-bottom-color: var(--mud-palette-tertiary) !important;
}

.custom-input .mud-input-adornment {
    color: var(--mud-palette-tertiary) !important;
}

/* INPUT BASE */
.custom-input .mud-input-root {
    border-radius: 12px;
    background-color: rgb(248 250 252);
    padding: 6px 12px;
}

/* underline base */
.custom-input .mud-input-underline:before {
    border-bottom: 1px solid rgb(203 213 225);
}

/* underline focus usando color del theme */
.custom-input .mud-input-underline:after {
    border-bottom: 2px solid var(--mud-palette-tertiary) !important;
}

/* icono del input */
.custom-input .mud-input-adornment {
    color: var(--mud-palette-tertiary) !important;
}

/* label focus */
.custom-input .mud-input-label.mud-focused {
    color: var(--mud-palette-tertiary) !important;
}

/* label cuando tiene valor */
.custom-input .mud-shrink ~ label.mud-input-label {
    color: var(--mud-palette-tertiary) !important;
}

/* quitar outline */
.custom-input input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.text-primary {
    color: var(--mud-palette-primary) !important;
}

.text-secondary {
    color: var(--mud-palette-secondary) !important;
}

.text-tertiary {
    color: var(--mud-palette-tertiary) !important;
}

.bg-primary-soft {
    background-color: var(--mud-palette-secondary) !important;
}
