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

:root {
    --primary: #ED6A4C;
    --primary-glow: rgba(237, 106, 76, 0.35);
    --accent: #293241;
    --nav-height: 70px;
}

[data-theme='dark'] {
    --bg-main: #0B0F19;
    --bg-card: rgba(20, 28, 45, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.08);
    --bg-gradient: 
        radial-gradient(at 0% 0%, rgba(237, 106, 76, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(41, 50, 65, 0.4) 0px, transparent 50%);
}

[data-theme='light'] {
    --bg-main: #f4f6f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #293241;
    --text-muted: #64748b;
    --glass-border: rgba(41, 50, 65, 0.08);
    --bg-gradient: 
        radial-gradient(at 0% 0%, rgba(237, 106, 76, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(41, 50, 65, 0.08) 0px, transparent 50%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    background-image: var(--bg-gradient);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 18px 45px 0 rgba(0, 0, 0, 0.22), 0 4px 15px 0 rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .glass-panel {
    box-shadow: 0 18px 45px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.08);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), #D9411E);
    color: white !important;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
    color: white !important;
}

.btn-cancel {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
    padding: 0 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b !important;
    border-color: #94a3b8;
}

.navbar,
.navbar-custom {
    height: var(--nav-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #C3BFC0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
}

[data-theme='light'] .navbar,
[data-theme='light'] .navbar-custom {
    background-color: #C3BFC0 !important;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
}

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

[data-theme='light'] .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
}

.container,
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Password Toggle Styles */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--text-main);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

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

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Sidebar Drawer Styles */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: -280px;
    width: 280px;
    height: calc(100vh - var(--nav-height));
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0,0,0,0.15);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
    transform: translateX(5px);
}

.sidebar-link.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Overlay for sidebar */
.sidebar-overlay {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 998;
}

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

/* Inline instruction icon for home page */
.instruction-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    background: #111111;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme='light'] .instruction-icon {
    background: #e2e8f0;
    color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Company & User Header Pills */
.company-dropdown,
.user-dropdown {
    position: relative;
    display: inline-block;
}

.switcher-btn {
    background: #0f172a;
    border: 1px solid #334155;
    color: #ffffff !important;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.switcher-btn:hover {
    background: #1e293b;
    border-color: #475569;
    transform: translateY(-1px);
}

/* Static pill — same look as switcher-btn but non-interactive (single company) */
.switcher-btn-static {
    cursor: default;
    pointer-events: none;
}

.switcher-btn-static:hover {
    transform: none;
    background: #0f172a;
    border-color: #334155;
}

/* Highlight active company in dropdown */
.dropdown-item-active {
    color: var(--primary) !important;
    background: var(--primary-glow);
    font-weight: 600;
}

.user-dropdown-btn {
    background: #e7562c;
    border: 1px solid #d44920;
    color: #ffffff !important;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(231, 86, 44, 0.3);
}

.user-dropdown-btn:hover {
    background: #d64920;
    transform: translateY(-1px);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 8px;
    overflow: hidden;
}

.user-dropdown-menu.show { 
    display: block; 
}

.dropdown-item-custom {
    padding: 10px 15px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
}

.dropdown-item-custom:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.dropdown-item-info {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    user-select: text;
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Landing Page Hero Component & Typography */
.hero-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    margin-top: 1rem;
}

.hero-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 800px;
    padding: 4.5rem 3rem 4rem 3rem;
    text-align: center;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.brand-dark {
    color: #232d3b; /* Color exacto de Imagi */
}

.brand-orange {
    color: #e7562c; /* Color exacto de Sign */
}

.hero-description {
    color: #607085;
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 580px;
    margin: 0 auto 2.5rem auto;
    font-weight: 400;
}

.hero-action {
    display: flex;
    justify-content: center;
}

.btn-orange-card,
.btn-orange {
    background-color: #e7562c;
    color: #ffffff !important;
    border: none;
    padding: 12px 34px;
    min-width: 180px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 8px 20px rgba(231, 86, 44, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-orange-card:hover,
.btn-orange:hover {
    background-color: #d64920;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(231, 86, 44, 0.45);
    color: #ffffff !important;
}

.header-btn {
    background-color: #e7562c;
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 14px rgba(231, 86, 44, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.header-btn:hover {
    background-color: #d64920;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(231, 86, 44, 0.45);
    color: #ffffff !important;
}

.app-footer {
    text-align: center;
    color: #64748b;
    font-size: 0.825rem;
    padding: 1.5rem 1rem 2rem 1rem;
    margin-top: auto;
}

.footer-legal {
    color: #e7562c;
    text-decoration: none;
    font-weight: 500;
}

.footer-legal:hover {
    text-decoration: underline;
}

/* Ocultar flechas de incremento/decremento en inputs numéricos */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Tarjetas de autenticación y formularios centrados responsivos */
.auth-card-container {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem 2rem;
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .auth-card-container {
        max-width: 100%;
        padding: 2rem 1.25rem;
        margin: 0 0.5rem;
    }
}

/* Tarjetas de formularios centrados (Crear / Editar usuarios, compañías, etc.) */
.form-card-container {
    width: 100%;
    max-width: 620px;
    padding: 2.5rem 2rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-card-container {
        max-width: 100%;
        padding: 1.5rem 1rem;
        margin: 0 0.25rem;
    }
}

/* Responsividad para barra superior y botones de usuario en móviles */
@media (max-width: 768px) {
    .navbar,
    .navbar-custom {
        height: auto;
        min-height: var(--nav-height);
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-logo {
        gap: 0.5rem;
    }

    .nav-logo img {
        height: 32px !important;
    }

    nav ul {
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }

    .switcher-btn,
    .user-dropdown-btn {
        padding: 5px 10px;
        font-size: 0.775rem;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .switcher-btn span,
    .user-dropdown-btn span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    .dashboard-header-instruction {
        font-size: 0.875rem !important;
        flex-wrap: wrap;
        gap: 6px !important;
        line-height: 1.4;
    }
}