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

:root {
  --vinotinto: #891E21;
  --vinotinto-dark: #6a1518;
  --vinotinto-light: rgba(137, 30, 33, 0.08);
  --gold: #D4AF37;
  --negro: #0a0a0a;
  --blanco: #ffffff;
  --gris-claro: #f8f9fa;
  --gris-medio: #e9ecef;
  --gris-oscuro: #343a40;
  --gris-texto: #6c757d;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-body);
    background: #f1f4f8;
    color: var(--negro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    position: relative;
}

/* ==================== FONDO ANIMADO ==================== */

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f1f4f8;
    z-index: 1;
    overflow: hidden;
}

/* Mesh gradient overlay */
.animated-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(137, 30, 33, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 50% 50%, rgba(137, 30, 33, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Particle grid */
.animated-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,0.06) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.07) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.05) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.06) 0%, transparent 100%);
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.18;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(137, 30, 33, 0.05) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation: float 14s ease-in-out infinite;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    bottom: -80px;
    left: 5%;
    animation: float 17s ease-in-out infinite 3s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(137, 30, 33, 0.03) 0%, transparent 70%);
    top: 40%;
    left: -120px;
    animation: float 20s ease-in-out infinite 6s;
}

.shape-4 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.03) 0%, transparent 70%);
    bottom: 15%;
    right: 8%;
    animation: float 16s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25%  { transform: translateY(-40px) translateX(25px) rotate(15deg); }
    50%  { transform: translateY(-80px) translateX(-25px) rotate(-10deg); }
    75%  { transform: translateY(-40px) translateX(25px) rotate(5deg); }
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */

.login-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    width: 95%;
    max-width: 1200px;
    animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(16px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ==================== SECCIÓN LOGO ==================== */

.logo-section {
    text-align: center;
    animation: slideDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-32px); }
    to   { opacity: 1; transform: translateY(0); }
}
.logo-circle {
    width: 130px;
    height: 130px;
    background: var(--blanco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border: 1px solid rgba(137, 30, 33, 0.1);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 2px 5px rgba(255,255,255,0.8);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(137, 30, 33, 0.04), 0 10px 30px rgba(0,0,0,0.06);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(137, 30, 33, 0.08), 0 15px 45px rgba(0,0,0,0.1);
        transform: scale(1.03);
    }
}

.logo-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    padding: 12px;
}

.logo-section h1 {
    color: var(--vinotinto);
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -2px;
}

.tagline {
    color: var(--gris-texto);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ==================== SECCIÓN DE AUTENTICACIÓN ==================== */

.auth-section {
    background: var(--blanco);
    border: 1px solid #e2e8f0;
    padding: 50px 48px;
    border-radius: 32px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    z-index: 10;
}

.auth-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--vinotinto), var(--gold));
}

.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    color: var(--gris-oscuro);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-align: left;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(248, 250, 252, 0.8);
    border: 1.5px solid #edf2f7;
    border-radius: 16px;
    color: var(--negro);
    font-size: 15px;
    font-family: var(--font-body);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--vinotinto);
    background: var(--blanco);
    box-shadow: 0 0 0 4px rgba(137, 30, 33, 0.08);
    transform: translateY(-1px);
}

.input-wrapper input::placeholder {
    color: #a0aec0;
    font-family: var(--font-body);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--vinotinto), var(--vinotinto-dark));
    color: white;
    border: none;
    border-radius: 16px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 12px;
    box-shadow: 0 10px 25px rgba(137, 30, 33, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(137, 30, 33, 0.35);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(-1px);
}

/* ==================== DIVISOR AUTH ==================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ==================== BOTÓN GOOGLE ==================== */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: var(--blanco);
    border: 1.5px solid #edf2f7;
    border-radius: 16px;
    color: var(--gris-oscuro);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
}


.btn-google:active {
    transform: translateY(0);
}

.btn-google:disabled {
    cursor: not-allowed;
}



/* ==================== BARRA DE INFO DE USUARIO ==================== */

.user-info-bar {
    width: 100%;
    background: var(--vinotinto);
    border: 1px solid var(--gold);
    border-radius: 50px;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(137, 30, 33, 0.3);
}

#activeUserLabel {
    color: white !important;
    font-size: 14px;
    font-weight: 600;
}

#activeUserLabel b {
    color: var(--gold) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-left: 6px;
}

.btn-small-link {
    background: transparent;
    color: rgba(148, 212, 252, 0.5);
    border: 1px solid rgba(148, 212, 252, 0.2);
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small-link:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #94d4fc;
    border-color: rgba(56, 189, 248, 0.4);
}

/* ==================== REJILLA DE MÓDULOS (TARJETAS) ==================== */

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* ==================== BOTÓN BASE (TARJETA) ==================== */

.btn-base {
    min-width: 0;
    padding: 36px 24px;
    background: var(--blanco);
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
}

/* Module icon image style */
.btn-icon-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-base span {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--negro);
    margin-top: 8px;
}

.btn-desc {
    font-size: 12px;
    color: var(--gris-texto);
    line-height: 1.4;
    margin-top: 4px;
    font-weight: 400;
}

/* Dev Badge Style */
.badge-dev {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #FDE68A;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 2;
}

.btn-base[data-status="dev"] .badge-dev {
    background: #e2e8f0;
    color: #64748b;
    border-color: #cbd5e0;
}

/* Shine sweep on hover */
.btn-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.btn-base:hover::after {
    left: 160%;
}

.btn-base:hover {
    transform: translateY(-10px);
    background: var(--blanco);
    border-color: var(--vinotinto);
    box-shadow: 0 20px 50px rgba(137, 30, 33, 0.12);
}

.btn-base:hover span {
    color: var(--vinotinto);
}

.btn-base:active {
    transform: translateY(-2px) scale(1.01);
}

/* ==================== VARIANTES DE COLOR (TARJETAS) ==================== */


/* Variantes de Hover */
.btn-blue:hover { border-color: #1e40af; }
.btn-red:hover { border-color: var(--vinotinto); }
.btn-green:hover { border-color: #10b981; }
.btn-orange:hover { border-color: var(--gold); }
.btn-purple:hover { border-color: #7c3aed; }
.btn-pink:hover { border-color: #db2777; }
.btn-amber:hover { border-color: #d97706; }
.btn-cyan:hover { border-color: #0891b2; }
.btn-gr:hover { border-color: #6366f1; }



/* Inactive / No Access Style */
.btn-base.no-access {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
}

.btn-base.no-access:hover {
    transform: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.05);
}

.btn-base.no-access img {
    opacity: 0.6;
}

/* ==================== MODAL DE CONTEXTO ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.context-card {
    background: var(--blanco);
    width: 95%;
    max-width: 460px;
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(137, 30, 33, 0.1);
    position: relative;
    overflow: hidden;
}

.context-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--vinotinto), var(--gold));
}

.context-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-circle-mini {
    width: 60px;
    height: 60px;
    background: var(--blanco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.logo-circle-mini img {
    width: 80%;
    object-fit: contain;
}

.context-header h3 {
    font-family: var(--font-heading);
    color: var(--vinotinto);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

.context-header p {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

.context-select {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--negro);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.context-select:focus:not(:disabled) {
    outline: none;
    border-color: var(--vinotinto);
    background-color: var(--blanco);
    box-shadow: 0 0 0 4px rgba(137, 30, 33, 0.08);
}

.context-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================== BARRA DE ESTADO ==================== */

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 22px;
    background: #1e293b;
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.status-text {
    color: rgba(255, 255, 255, 0.7) !important;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ==================== BOTÓN CERRAR SESIÓN ==================== */

.btn-logout-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.btn-logout-small:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fecaca;
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.logout-icon {
    font-size: 13px;
}

/* ==================== ESTADOS SIN ACCESO ==================== */

.btn-base.no-access,
.btn-base[data-status="dev"] {
    opacity: 0.22 !important;
    cursor: not-allowed !important;
    filter: grayscale(1);
    pointer-events: none;
}

.btn-base.no-access:hover,
.btn-base[data-status="dev"]:hover {
    transform: none;
    box-shadow: none;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .logo-section h1 {
        font-size: 40px;
    }

    .tagline {
        font-size: 12px;
    }

    .buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .shape {
        opacity: 0.1;
    }

    .login-container {
        gap: 28px;
    }
}

@media (max-width: 520px) {
    .logo-circle {
        width: 90px;
        height: 90px;
    }

    .logo-section h1 {
        font-size: 34px;
    }

    .buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .btn-base {
        padding: 18px 12px 16px;
        font-size: 10px;
    }

    .btn-base::before {
        width: 42px;
        height: 42px;
        font-size: 22px;
        border-radius: 11px;
    }

    .login-container {
        gap: 22px;
    }
}

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