/**
 * Botón y modal de acceso rápido a iniciar sesión (header Viive).
 */
.viive-acceso-rapido-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: 8px;
    z-index: 1002;
    position: relative;
}

.viive-acceso-rapido-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid rgba(102, 126, 234, 0.45);
    border-radius: 50%;
    background: #fff;
    color: #667eea;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.viive-acceso-rapido-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}

.viive-acceso-rapido-btn:focus-visible {
    outline: 2px solid #764ba2;
    outline-offset: 2px;
}

.viive-acceso-rapido-btn svg {
    width: 22px;
    height: 22px;
}

/* Modal */
.viive-modal-acceso {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.viive-modal-acceso.viive-modal-acceso-visible {
    display: flex;
}

.viive-modal-acceso-caja {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    font-family: 'Poppins', system-ui, sans-serif;
}

.viive-modal-acceso-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e8ecf4;
    background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
}

.viive-modal-acceso-cabecera h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
}

.viive-modal-acceso-cerrar {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s;
}

.viive-modal-acceso-cerrar:hover {
    background: #e2e8f0;
}

.viive-modal-acceso-cuerpo {
    padding: 20px;
}

.viive-modal-acceso-cuerpo label.viive-label-bloque {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

/* Una sola línea: desplegable con las cuatro formas de uso */
.viive-rol-select-wrap {
    margin-bottom: 18px;
    position: relative;
}

.viive-rol-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #64748b;
    pointer-events: none;
}

select.viive-rol-select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 40px 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 500;
    color: #334155;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 1.35;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.viive-rol-select:hover {
    border-color: #94a3b8;
}

select.viive-rol-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.viive-modal-acceso-campo {
    margin-bottom: 14px;
}

.viive-modal-acceso-campo label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
}

.viive-modal-acceso-campo input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
}

.viive-modal-acceso-campo input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.viive-acceso-error {
    display: none;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.85rem;
}

.viive-acceso-error.viive-acceso-error-visible {
    display: block;
}

.viive-modal-acceso-enviar {
    width: 100%;
    margin-top: 6px;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: opacity 0.2s, transform 0.15s;
}

.viive-modal-acceso-enviar:hover:not(:disabled) {
    opacity: 0.95;
    transform: translateY(-1px);
}

.viive-modal-acceso-enviar:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.viive-modal-acceso-pie {
    margin-top: 14px;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
}

.viive-modal-acceso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

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

.viive-modal-acceso-oauth-tit {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

.viive-modal-acceso-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.viive-btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.viive-btn-oauth:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.viive-btn-oauth--facebook {
    background: #1877f2;
    color: #fff;
}

.viive-btn-oauth--facebook i {
    font-size: 1.1rem;
}

.viive-btn-oauth--google {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
}

.viive-btn-oauth--google i {
    font-size: 1.05rem;
    color: #4285f4;
}

.viive-modal-crear {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.viive-modal-crear-link {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    color: #667eea;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.viive-modal-crear-link:hover {
    color: #5b4dc7;
}

/* Sesión iniciada: avatar + menú */
.viive-menu-usuario {
    position: relative;
}

.viive-acceso-perfil-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid rgba(102, 126, 234, 0.45);
    border-radius: 50%;
    background: linear-gradient(135deg, #eef0ff 0%, #f5f0ff 100%);
    color: #5b21b6;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.viive-acceso-perfil-btn:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

.viive-acceso-perfil-btn:focus-visible {
    outline: 2px solid #764ba2;
    outline-offset: 2px;
}

.viive-acceso-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.viive-acceso-inicial {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Poppins', system-ui, sans-serif;
    line-height: 1;
}

.viive-menu-usuario-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    z-index: 10060;
}

.viive-menu-usuario-dropdown[hidden] {
    display: none !important;
}

.viive-menu-usuario-dropdown-visible {
    display: block !important;
}

.viive-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.92rem;
    font-family: inherit;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease;
}

.viive-menu-item:hover {
    background: #f1f5f9;
}

.viive-menu-item-danger {
    color: #b91c1c;
}

.viive-menu-item-danger:hover {
    background: #fef2f2;
}
